From e6f21137ad9830e4b9614bc94eab0c302cdfb29a Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Thu, 7 Apr 2016 00:52:50 +0200 Subject: [PATCH 1/3] Undefined or default return points fixed. --- src/Composer/Command/ExecCommand.php | 2 +- src/Composer/Command/RunScriptCommand.php | 2 +- src/Composer/Command/ShowCommand.php | 2 +- src/Composer/Downloader/HgDownloader.php | 2 +- src/Composer/Downloader/SvnDownloader.php | 2 +- src/Composer/Factory.php | 3 ++- src/Composer/Package/Archiver/BaseExcludeFilter.php | 2 +- src/Composer/Package/Archiver/GitExcludeFilter.php | 7 ++----- src/Composer/Repository/ArrayRepository.php | 1 + src/Composer/Repository/RepositoryManager.php | 1 + src/Composer/Util/TlsHelper.php | 3 ++- 11 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Composer/Command/ExecCommand.php b/src/Composer/Command/ExecCommand.php index 0938f6659..34d1362e5 100644 --- a/src/Composer/Command/ExecCommand.php +++ b/src/Composer/Command/ExecCommand.php @@ -69,7 +69,7 @@ EOT ); } - return; + return 0; } $binary = $input->getArgument('binary'); diff --git a/src/Composer/Command/RunScriptCommand.php b/src/Composer/Command/RunScriptCommand.php index 296c658fa..6742f9034 100644 --- a/src/Composer/Command/RunScriptCommand.php +++ b/src/Composer/Command/RunScriptCommand.php @@ -70,7 +70,7 @@ EOT if ($input->getOption('list')) { return $this->listScripts(); } elseif (!$input->getArgument('script')) { - throw new \RunTimeException('Missing required argument "script"'); + throw new \RuntimeException('Missing required argument "script"'); } $script = $input->getArgument('script'); diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index a76fec042..fbc704d61 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -89,7 +89,7 @@ EOT if ($input->getOption('tree') && ($input->getOption('all') || $input->getOption('available'))) { $io->writeError('The --tree (-t) option is not usable in combination with --all or --available (-a)'); - return; + return 0; } // init repos diff --git a/src/Composer/Downloader/HgDownloader.php b/src/Composer/Downloader/HgDownloader.php index 6041d1dc6..dc1d35464 100644 --- a/src/Composer/Downloader/HgDownloader.php +++ b/src/Composer/Downloader/HgDownloader.php @@ -69,7 +69,7 @@ class HgDownloader extends VcsDownloader public function getLocalChanges(PackageInterface $package, $path) { if (!is_dir($path.'/.hg')) { - return; + return null; } $this->process->execute('hg st', $output, realpath($path)); diff --git a/src/Composer/Downloader/SvnDownloader.php b/src/Composer/Downloader/SvnDownloader.php index b71e22b31..a21f35858 100644 --- a/src/Composer/Downloader/SvnDownloader.php +++ b/src/Composer/Downloader/SvnDownloader.php @@ -73,7 +73,7 @@ class SvnDownloader extends VcsDownloader public function getLocalChanges(PackageInterface $package, $path) { if (!$this->hasMetadataRepository($path)) { - return; + return null; } $this->process->execute('svn status --ignore-externals', $output, $path); diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 720a2f066..c05a57036 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -25,6 +25,7 @@ use Composer\Util\Platform; use Composer\Util\ProcessExecutor; use Composer\Util\RemoteFilesystem; use Composer\Util\Silencer; +use Seld\JsonLint\DuplicateKeyException; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Composer\EventDispatcher\EventDispatcher; use Composer\Autoload\AutoloadGenerator; @@ -270,7 +271,7 @@ class Factory $jsonParser = new JsonParser; try { $jsonParser->parse(file_get_contents($localConfig), JsonParser::DETECT_KEY_CONFLICTS); - } catch (\Seld\JsonLint\DuplicateKeyException $e) { + } catch (DuplicateKeyException $e) { $details = $e->getDetails(); $io->writeError('Key '.$details['key'].' is a duplicate in '.$localConfig.' at line '.$details['line'].''); } diff --git a/src/Composer/Package/Archiver/BaseExcludeFilter.php b/src/Composer/Package/Archiver/BaseExcludeFilter.php index c94c52a6b..99ba24431 100644 --- a/src/Composer/Package/Archiver/BaseExcludeFilter.php +++ b/src/Composer/Package/Archiver/BaseExcludeFilter.php @@ -83,7 +83,7 @@ abstract class BaseExcludeFilter $line = trim($line); if (!$line || 0 === strpos($line, '#')) { - return; + return null; } return call_user_func($lineParser, $line); diff --git a/src/Composer/Package/Archiver/GitExcludeFilter.php b/src/Composer/Package/Archiver/GitExcludeFilter.php index 926bb4d69..004ceb8ca 100644 --- a/src/Composer/Package/Archiver/GitExcludeFilter.php +++ b/src/Composer/Package/Archiver/GitExcludeFilter.php @@ -69,12 +69,9 @@ class GitExcludeFilter extends BaseExcludeFilter { $parts = preg_split('#\s+#', $line); - if (count($parts) != 2) { - return null; - } - - if ($parts[1] === 'export-ignore') { + if (count($parts) == 2 && $parts[1] === 'export-ignore') { return $this->generatePattern($parts[0]); } + return null; } } diff --git a/src/Composer/Repository/ArrayRepository.php b/src/Composer/Repository/ArrayRepository.php index 852515493..89cedaed0 100644 --- a/src/Composer/Repository/ArrayRepository.php +++ b/src/Composer/Repository/ArrayRepository.php @@ -56,6 +56,7 @@ class ArrayRepository extends BaseRepository } } } + return null; } /** diff --git a/src/Composer/Repository/RepositoryManager.php b/src/Composer/Repository/RepositoryManager.php index 649c66cd9..f3c5912b0 100644 --- a/src/Composer/Repository/RepositoryManager.php +++ b/src/Composer/Repository/RepositoryManager.php @@ -58,6 +58,7 @@ class RepositoryManager return $package; } } + return null; } /** diff --git a/src/Composer/Util/TlsHelper.php b/src/Composer/Util/TlsHelper.php index 1afb4bb21..137511a70 100644 --- a/src/Composer/Util/TlsHelper.php +++ b/src/Composer/Util/TlsHelper.php @@ -70,7 +70,7 @@ final class TlsHelper } if (!isset($info['subject']['commonName'])) { - return; + return null; } $commonName = strtolower($info['subject']['commonName']); @@ -82,6 +82,7 @@ final class TlsHelper if (0 === strpos($name, 'DNS:')) { return strtolower(ltrim(substr($name, 4))); } + return null; }, $subjectAltNames)); $subjectAltNames = array_values($subjectAltNames); } From 818c3e707a1556bc3ecff7cc41c110e0db593665 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Thu, 7 Apr 2016 01:12:30 +0200 Subject: [PATCH 2/3] 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) From eb77c0b7f580a8def3da5b3d56dac86bbb16f2de Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Thu, 7 Apr 2016 23:12:23 +0200 Subject: [PATCH 3/3] phpDoc cleanup, removed unused imports, variables and parameters. --- src/Composer/Autoload/AutoloadGenerator.php | 4 ++-- src/Composer/Command/BaseDependencyCommand.php | 1 + src/Composer/Command/HomeCommand.php | 2 +- src/Composer/Command/SearchCommand.php | 1 - src/Composer/Config.php | 3 ++- src/Composer/IO/ConsoleIO.php | 14 ++++++++++++++ src/Composer/Installer/PearBinaryInstaller.php | 2 -- src/Composer/Installer/PearInstaller.php | 1 - .../Installer/SuggestedPackagesReporter.php | 2 +- src/Composer/Package/Loader/RootPackageLoader.php | 4 ++-- src/Composer/Repository/Pear/ChannelReader.php | 1 - src/Composer/Repository/RepositoryFactory.php | 8 +++++++- src/Composer/Repository/Vcs/HgDriver.php | 1 - src/Composer/Util/ErrorHandler.php | 4 ++-- src/Composer/Util/Git.php | 1 - src/Composer/Util/GitLab.php | 1 + src/Composer/Util/Svn.php | 1 - 17 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 485183ac2..b5950d243 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -18,7 +18,7 @@ use Composer\Installer\InstallationManager; use Composer\IO\IOInterface; use Composer\Package\AliasPackage; use Composer\Package\PackageInterface; -use Composer\Repository\InstalledRepositoryInterface; +use Composer\Repository\WritableRepositoryInterface; use Composer\Util\Filesystem; use Composer\Script\ScriptEvents; @@ -85,7 +85,7 @@ class AutoloadGenerator $this->runScripts = (boolean) $runScripts; } - public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') + public function dump(Config $config, WritableRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') { if ($this->classMapAuthoritative) { // Force scanPsr0Packages when classmap is authoritative diff --git a/src/Composer/Command/BaseDependencyCommand.php b/src/Composer/Command/BaseDependencyCommand.php index e4be22bac..f9ba20b0d 100644 --- a/src/Composer/Command/BaseDependencyCommand.php +++ b/src/Composer/Command/BaseDependencyCommand.php @@ -221,6 +221,7 @@ class BaseDependencyCommand extends BaseCommand /** * @var PackageInterface $package * @var Link $link + * @var array|bool $children */ list($package, $link, $children) = $result; diff --git a/src/Composer/Command/HomeCommand.php b/src/Composer/Command/HomeCommand.php index 38be76d77..05e89d248 100644 --- a/src/Composer/Command/HomeCommand.php +++ b/src/Composer/Command/HomeCommand.php @@ -67,7 +67,7 @@ EOT foreach ($repos as $repo) { foreach ($repo->findPackages($packageName) as $package) { $packageExists = true; - if ($this->handlePackage($package, $input->getOption('homepage'), $input->getOption('show'))) { + if ($package instanceof CompletePackageInterface && $this->handlePackage($package, $input->getOption('homepage'), $input->getOption('show'))) { $handled = true; break 2; } diff --git a/src/Composer/Command/SearchCommand.php b/src/Composer/Command/SearchCommand.php index 97a27ac18..1b88af331 100644 --- a/src/Composer/Command/SearchCommand.php +++ b/src/Composer/Command/SearchCommand.php @@ -19,7 +19,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Composer\Repository\CompositeRepository; use Composer\Repository\PlatformRepository; -use Composer\Repository\RepositoryFactory; use Composer\Repository\RepositoryInterface; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 4c16913cf..9bb7feb23 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -80,7 +80,8 @@ class Config private $useEnvironment; /** - * @param bool $useEnvironment Use COMPOSER_ environment variables to replace config settings + * @param bool $useEnvironment Use COMPOSER_ environment variables to replace config settings + * @param string $baseDir Optional base directory of the config */ public function __construct($useEnvironment = true, $baseDir = null) { diff --git a/src/Composer/IO/ConsoleIO.php b/src/Composer/IO/ConsoleIO.php index e6a4bf537..b09ed0582 100644 --- a/src/Composer/IO/ConsoleIO.php +++ b/src/Composer/IO/ConsoleIO.php @@ -27,12 +27,20 @@ use Symfony\Component\Console\Question\Question; */ class ConsoleIO extends BaseIO { + /** @var InputInterface */ protected $input; + /** @var OutputInterface */ protected $output; + /** @var HelperSet */ protected $helperSet; + /** @var string */ protected $lastMessage; + /** @var string */ protected $lastMessageErr; + + /** @var float */ private $startTime; + /** @var array */ private $verbosityMap; /** @@ -56,6 +64,9 @@ class ConsoleIO extends BaseIO ); } + /** + * @param float $startTime + */ public function enableDebugging($startTime) { $this->startTime = $startTime; @@ -274,6 +285,9 @@ class ConsoleIO extends BaseIO return $default; } + /** + * @return OutputInterface + */ private function getErrorOutput() { if ($this->output instanceof ConsoleOutputInterface) { diff --git a/src/Composer/Installer/PearBinaryInstaller.php b/src/Composer/Installer/PearBinaryInstaller.php index 752068ca2..d0c63c410 100644 --- a/src/Composer/Installer/PearBinaryInstaller.php +++ b/src/Composer/Installer/PearBinaryInstaller.php @@ -15,9 +15,7 @@ namespace Composer\Installer; use Composer\IO\IOInterface; use Composer\Package\PackageInterface; use Composer\Util\Filesystem; -use Composer\Util\Platform; use Composer\Util\ProcessExecutor; -use Composer\Util\Silencer; /** * Utility to handle installation of package "bin"/binaries for PEAR packages diff --git a/src/Composer/Installer/PearInstaller.php b/src/Composer/Installer/PearInstaller.php index ad4d78225..b4aa465ed 100644 --- a/src/Composer/Installer/PearInstaller.php +++ b/src/Composer/Installer/PearInstaller.php @@ -18,7 +18,6 @@ use Composer\Downloader\PearPackageExtractor; use Composer\Repository\InstalledRepositoryInterface; use Composer\Package\PackageInterface; use Composer\Util\Platform; -use Composer\Util\ProcessExecutor; use Composer\Util\Filesystem; /** diff --git a/src/Composer/Installer/SuggestedPackagesReporter.php b/src/Composer/Installer/SuggestedPackagesReporter.php index 777ab1330..2d5ab2d63 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 IOInterface */ private $io; diff --git a/src/Composer/Package/Loader/RootPackageLoader.php b/src/Composer/Package/Loader/RootPackageLoader.php index 00a0020e9..64352f961 100644 --- a/src/Composer/Package/Loader/RootPackageLoader.php +++ b/src/Composer/Package/Loader/RootPackageLoader.php @@ -13,9 +13,9 @@ namespace Composer\Package\Loader; use Composer\Package\BasePackage; -use Composer\Package\PackageInterface; use Composer\Package\AliasPackage; use Composer\Config; +use Composer\Package\RootPackageInterface; use Composer\Repository\RepositoryFactory; use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionParser; @@ -59,7 +59,7 @@ class RootPackageLoader extends ArrayLoader * @param array $config package data * @param string $class FQCN to be instantiated * @param string $cwd cwd of the root package to be used to guess the version if it is not provided - * @return PackageInterface + * @return RootPackageInterface */ public function load(array $config, $class = 'Composer\Package\RootPackage', $cwd = null) { diff --git a/src/Composer/Repository/Pear/ChannelReader.php b/src/Composer/Repository/Pear/ChannelReader.php index e8e992ca5..00b62b89c 100644 --- a/src/Composer/Repository/Pear/ChannelReader.php +++ b/src/Composer/Repository/Pear/ChannelReader.php @@ -53,7 +53,6 @@ class ChannelReader extends BaseChannelReader $xml = $this->requestXml($url, "/channel.xml"); $channelName = (string) $xml->name; - $channelSummary = (string) $xml->summary; $channelAlias = (string) $xml->suggestedalias; $supportedVersions = array_keys($this->readerMap); diff --git a/src/Composer/Repository/RepositoryFactory.php b/src/Composer/Repository/RepositoryFactory.php index 08146546f..95b5cc13d 100644 --- a/src/Composer/Repository/RepositoryFactory.php +++ b/src/Composer/Repository/RepositoryFactory.php @@ -70,9 +70,12 @@ class RepositoryFactory } /** + * @param IOInterface $io + * @param Config $config + * @param array $repoConfig * @return RepositoryInterface */ - public static function createRepo($io, $config, array $repoConfig) + public static function createRepo(IOInterface $io, Config $config, array $repoConfig) { $rm = static::manager($io, $config, null, Factory::createRemoteFilesystem($io, $config)); $repos = static::createRepos($rm, array($repoConfig)); @@ -81,6 +84,9 @@ class RepositoryFactory } /** + * @param IOInterface|null $io + * @param Config|null $config + * @param RepositoryManager|null $rm * @return RepositoryInterface[] */ public static function defaultRepos(IOInterface $io = null, Config $config = null, RepositoryManager $rm = null) diff --git a/src/Composer/Repository/Vcs/HgDriver.php b/src/Composer/Repository/Vcs/HgDriver.php index caabc5f60..c5432b792 100644 --- a/src/Composer/Repository/Vcs/HgDriver.php +++ b/src/Composer/Repository/Vcs/HgDriver.php @@ -17,7 +17,6 @@ use Composer\Json\JsonFile; use Composer\Util\ProcessExecutor; use Composer\Util\Filesystem; use Composer\IO\IOInterface; -use Composer\Downloader\TransportException; /** * @author Per Bernhardt diff --git a/src/Composer/Util/ErrorHandler.php b/src/Composer/Util/ErrorHandler.php index ddb4b570b..925cab74c 100644 --- a/src/Composer/Util/ErrorHandler.php +++ b/src/Composer/Util/ErrorHandler.php @@ -66,9 +66,9 @@ class ErrorHandler } /** - * Register error handler + * Register error handler. * - * @static + * @param IOInterface|null $io */ public static function register(IOInterface $io = null) { diff --git a/src/Composer/Util/Git.php b/src/Composer/Util/Git.php index 2df7161ed..78819060b 100644 --- a/src/Composer/Util/Git.php +++ b/src/Composer/Util/Git.php @@ -14,7 +14,6 @@ namespace Composer\Util; use Composer\Config; use Composer\IO\IOInterface; -use Composer\Downloader\TransportException; /** * @author Jordi Boggiano diff --git a/src/Composer/Util/GitLab.php b/src/Composer/Util/GitLab.php index bed071c41..1cfe6b15d 100644 --- a/src/Composer/Util/GitLab.php +++ b/src/Composer/Util/GitLab.php @@ -70,6 +70,7 @@ class GitLab /** * Authorizes a GitLab domain interactively via OAuth. * + * @param string $scheme Scheme used in the origin URL * @param string $originUrl The host this GitLab instance is located at * @param string $message The reason this authorization is required * diff --git a/src/Composer/Util/Svn.php b/src/Composer/Util/Svn.php index 100325f93..1e53e57ae 100644 --- a/src/Composer/Util/Svn.php +++ b/src/Composer/Util/Svn.php @@ -13,7 +13,6 @@ namespace Composer\Util; use Composer\Config; -use Composer\Downloader\TransportException; use Composer\IO\IOInterface; /**