From e137046558ba8d718923e832983a588136706b6c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 17 Oct 2021 10:18:22 +0200 Subject: [PATCH] Type annotations --- src/Composer/Compiler.php | 3 + src/Composer/Composer.php | 3 + src/Composer/Config.php | 12 ++++ src/Composer/Console/Application.php | 6 ++ src/Composer/Console/HtmlOutputFormatter.php | 6 ++ src/Composer/DependencyResolver/Decisions.php | 72 +++++++++++++++++++ .../DependencyResolver/DefaultPolicy.php | 20 ++++++ .../DependencyResolver/GenericRule.php | 6 ++ .../DependencyResolver/LockTransaction.php | 3 + .../DependencyResolver/MultiConflictRule.php | 6 ++ .../Operation/InstallOperation.php | 3 + .../Operation/UninstallOperation.php | 3 + .../Operation/UpdateOperation.php | 3 + src/Composer/DependencyResolver/Pool.php | 1 + 14 files changed, 147 insertions(+) diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 6ec0c43ef..fc34ba3f6 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -280,6 +280,9 @@ class Compiler return $output; } + /** + * @return string + */ private function getStub() { $stub = <<<'EOF' diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index e2bcc0225..6c54c7884 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -67,6 +67,9 @@ class Composer */ const RUNTIME_API_VERSION = '2.1.0'; + /** + * @return string + */ public static function getVersion() { // no replacement done, this must be a source checkout diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 30110331f..175f03d35 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -119,6 +119,9 @@ class Config $this->configSource = $source; } + /** + * @return ConfigSourceInterface + */ public function getConfigSource() { return $this->configSource; @@ -129,6 +132,9 @@ class Config $this->authConfigSource = $source; } + /** + * @return ConfigSourceInterface + */ public function getAuthConfigSource() { return $this->authConfigSource; @@ -373,6 +379,9 @@ class Config } } + /** + * @return array + */ public function all($flags = 0) { $all = array( @@ -385,6 +394,9 @@ class Config return $all; } + /** + * @return array + */ public function raw() { return array( diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 5c104737b..a71596bd5 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -468,6 +468,9 @@ class Application extends BaseApplication return $this->io; } + /** + * @return string + */ public function getHelp() { return self::$logo . parent::getHelp(); @@ -548,6 +551,9 @@ class Application extends BaseApplication return $definition; } + /** + * @return Command\BaseCommand[] + */ private function getPluginCommands() { $commands = array(); diff --git a/src/Composer/Console/HtmlOutputFormatter.php b/src/Composer/Console/HtmlOutputFormatter.php index acef97325..d39027f02 100644 --- a/src/Composer/Console/HtmlOutputFormatter.php +++ b/src/Composer/Console/HtmlOutputFormatter.php @@ -58,6 +58,9 @@ class HtmlOutputFormatter extends OutputFormatter parent::__construct(true, $styles); } + /** + * @return string + */ public function format($message) { $formatted = parent::format($message); @@ -67,6 +70,9 @@ class HtmlOutputFormatter extends OutputFormatter return preg_replace_callback("{\033\[([0-9;]+)m(.*?)\033\[(?:".$clearEscapeCodes.";)*?".$clearEscapeCodes."m}s", array($this, 'formatHtml'), $formatted); } + /** + * @return string + */ private function formatHtml($matches) { $out = '