From 818c3e707a1556bc3ecff7cc41c110e0db593665 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Thu, 7 Apr 2016 01:12:30 +0200 Subject: [PATCH] Ton of phpDoc fixes. --- src/Composer/Command/BaseDependencyCommand.php | 5 +++-- src/Composer/Command/CreateProjectCommand.php | 1 + src/Composer/Command/LicensesCommand.php | 2 ++ src/Composer/Command/SelfUpdateCommand.php | 3 +++ src/Composer/Command/ShowCommand.php | 12 ++++++++++-- src/Composer/DependencyResolver/Request.php | 3 +++ src/Composer/EventDispatcher/EventDispatcher.php | 4 +--- src/Composer/IO/BufferIO.php | 13 +++++-------- src/Composer/Installer/PearBinaryInstaller.php | 10 ++++++---- .../Installer/SuggestedPackagesReporter.php | 2 +- src/Composer/Json/JsonFile.php | 3 ++- src/Composer/Repository/ComposerRepository.php | 1 + src/Composer/Repository/RepositoryFactory.php | 10 +++++++++- 13 files changed, 47 insertions(+), 22 deletions(-) diff --git a/src/Composer/Command/BaseDependencyCommand.php b/src/Composer/Command/BaseDependencyCommand.php index f02eb8e13..e4be22bac 100644 --- a/src/Composer/Command/BaseDependencyCommand.php +++ b/src/Composer/Command/BaseDependencyCommand.php @@ -209,8 +209,9 @@ class BaseDependencyCommand extends BaseCommand /** * Recursively prints a tree of the selected results. * - * @param array $results - * @param string $prefix + * @param array $results Results to be printed at this level. + * @param string $prefix Prefix of the current tree level. + * @param int $level Current level of recursion. */ protected function printTree($results, $prefix = '', $level = 1) { diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index a4a48e176..bb0fb0bc8 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -362,6 +362,7 @@ EOT * @param InputInterface $input * @param bool $preferSource * @param bool $preferDist + * @param bool $keepVcsRequiresPreferSource */ protected function updatePreferredOptions(Config $config, InputInterface $input, &$preferSource, &$preferDist, $keepVcsRequiresPreferSource = false) { diff --git a/src/Composer/Command/LicensesCommand.php b/src/Composer/Command/LicensesCommand.php index 7cb250607..889a2920b 100644 --- a/src/Composer/Command/LicensesCommand.php +++ b/src/Composer/Command/LicensesCommand.php @@ -114,6 +114,8 @@ EOT * * @param RepositoryInterface $repo * @param PackageInterface $package + * @param array $bucket + * @return array */ private function filterRequiredPackages(RepositoryInterface $repo, PackageInterface $package, $bucket = array()) { diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index 2ba0cedfb..986b26662 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -305,6 +305,8 @@ TAGSPUBKEY * @param string $localFilename * @param string $newFilename * @param string $backupTarget + * @return \Exception|null + * @throws \Exception */ protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null) { @@ -323,6 +325,7 @@ TAGSPUBKEY } rename($newFilename, $localFilename); + return null; } catch (\Exception $e) { if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) { throw $e; diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index fbc704d61..df9e5e944 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -332,7 +332,11 @@ EOT } /** - * prints package meta data + * Prints package metadata. + * + * @param CompletePackageInterface $package + * @param array $versions + * @param RepositoryInterface $installedRepo */ protected function printMeta(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo) { @@ -389,7 +393,11 @@ EOT } /** - * prints all available versions of this package and highlights the installed one if any + * Prints all available versions of this package and highlights the installed one if any. + * + * @param CompletePackageInterface $package + * @param array $versions + * @param RepositoryInterface $installedRepo */ protected function printVersions(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo) { diff --git a/src/Composer/DependencyResolver/Request.php b/src/Composer/DependencyResolver/Request.php index 7eacdf1f6..d5c47954b 100644 --- a/src/Composer/DependencyResolver/Request.php +++ b/src/Composer/DependencyResolver/Request.php @@ -45,6 +45,9 @@ class Request * Mark an existing package as being installed and having to remain installed * * These jobs will not be tempered with by the solver + * + * @param string $packageName + * @param ConstraintInterface|null $constraint */ public function fix($packageName, ConstraintInterface $constraint = null) { diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 70a370722..a4c9d3061 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -137,11 +137,9 @@ class EventDispatcher * Triggers the listeners of an event. * * @param Event $event The event object to pass to the event handlers/listeners. - * @param string $additionalArgs - * @throws \RuntimeException - * @throws \Exception * @return int return code of the executed script if any, for php scripts a false return * value is changed to 1, anything else to 0 + * @throws \RuntimeException|\Exception */ protected function doDispatch(Event $event) { diff --git a/src/Composer/IO/BufferIO.php b/src/Composer/IO/BufferIO.php index 1069c0d9a..d47d4eaa5 100644 --- a/src/Composer/IO/BufferIO.php +++ b/src/Composer/IO/BufferIO.php @@ -23,15 +23,12 @@ use Symfony\Component\Console\Helper\HelperSet; class BufferIO extends ConsoleIO { /** - * @param string $input - * @param int $verbosity - * @param OutputFormatterInterface $formatter + * @param string $input + * @param int $verbosity + * @param OutputFormatterInterface|null $formatter */ - public function __construct( - $input = '', - $verbosity = StreamOutput::VERBOSITY_NORMAL, - OutputFormatterInterface $formatter = null - ) { + public function __construct($input = '', $verbosity = StreamOutput::VERBOSITY_NORMAL, OutputFormatterInterface $formatter = null) + { $input = new StringInput($input); $input->setInteractive(false); diff --git a/src/Composer/Installer/PearBinaryInstaller.php b/src/Composer/Installer/PearBinaryInstaller.php index 222b880b2..752068ca2 100644 --- a/src/Composer/Installer/PearBinaryInstaller.php +++ b/src/Composer/Installer/PearBinaryInstaller.php @@ -30,10 +30,12 @@ class PearBinaryInstaller extends BinaryInstaller private $vendorDir; /** - * @param IOInterface $io - * @param string $binDir - * @param string $binCompat - * @param Filesystem $filesystem + * @param IOInterface $io + * @param string $binDir + * @param string $vendorDir + * @param string $binCompat + * @param Filesystem $filesystem + * @param PearInstaller $installer */ public function __construct(IOInterface $io, $binDir, $vendorDir, $binCompat, Filesystem $filesystem, PearInstaller $installer) { diff --git a/src/Composer/Installer/SuggestedPackagesReporter.php b/src/Composer/Installer/SuggestedPackagesReporter.php index d56628ceb..777ab1330 100644 --- a/src/Composer/Installer/SuggestedPackagesReporter.php +++ b/src/Composer/Installer/SuggestedPackagesReporter.php @@ -29,7 +29,7 @@ class SuggestedPackagesReporter protected $suggestedPackages = array(); /** - * @var Composer\IO\IOInterface + * @var \Composer\IO\IOInterface */ private $io; diff --git a/src/Composer/Json/JsonFile.php b/src/Composer/Json/JsonFile.php index 4a6eb89ca..2a59e592f 100644 --- a/src/Composer/Json/JsonFile.php +++ b/src/Composer/Json/JsonFile.php @@ -43,6 +43,7 @@ class JsonFile * * @param string $path path to a lockfile * @param RemoteFilesystem $rfs required for loading http/https json files + * @param IOInterface $io * @throws \InvalidArgumentException */ public function __construct($path, RemoteFilesystem $rfs = null, IOInterface $io = null) @@ -105,7 +106,7 @@ class JsonFile * * @param array $hash writes hash into json file * @param int $options json_encode options (defaults to JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) - * @throws \UnexpectedValueException + * @throws \UnexpectedValueException|\Exception */ public function write(array $hash, $options = 448) { diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 035c2b0d7..fd55610ae 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -272,6 +272,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito * @param Pool $pool * @param string $name package name * @param bool $bypassFilters If set to true, this bypasses the stability filtering, and forces a recompute without cache + * @return array|mixed */ public function whatProvides(Pool $pool, $name, $bypassFilters = false) { diff --git a/src/Composer/Repository/RepositoryFactory.php b/src/Composer/Repository/RepositoryFactory.php index 681e3bfee..08146546f 100644 --- a/src/Composer/Repository/RepositoryFactory.php +++ b/src/Composer/Repository/RepositoryFactory.php @@ -25,7 +25,11 @@ use Composer\Json\JsonFile; class RepositoryFactory { /** - * @return array + * @param IOInterface $io + * @param Config $config + * @param string $repository + * @param bool $allowFilesystem + * @return array|mixed */ public static function configFromString(IOInterface $io, Config $config, $repository, $allowFilesystem = false) { @@ -52,6 +56,10 @@ class RepositoryFactory } /** + * @param IOInterface $io + * @param Config $config + * @param string $repository + * @param bool $allowFilesystem * @return RepositoryInterface */ public static function fromString(IOInterface $io, Config $config, $repository, $allowFilesystem = false)