From eb77c0b7f580a8def3da5b3d56dac86bbb16f2de Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Thu, 7 Apr 2016 23:12:23 +0200 Subject: [PATCH] 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; /**