From 4c9e75c6e58fbef6c58f44debfa77f5fae8a2c1c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 3 Jun 2021 10:38:38 +0200 Subject: [PATCH] Fix CS --- src/Composer/Command/InitCommand.php | 6 +++--- src/Composer/Command/ReinstallCommand.php | 1 + src/Composer/Command/ShowCommand.php | 2 -- src/Composer/DependencyResolver/GenericRule.php | 4 ++-- .../DependencyResolver/MultiConflictRule.php | 4 ++-- src/Composer/DependencyResolver/Problem.php | 4 ++-- src/Composer/DependencyResolver/Rule.php | 1 - src/Composer/DependencyResolver/Rule2Literals.php | 6 +++--- src/Composer/DependencyResolver/RuleSetGenerator.php | 8 ++++---- src/Composer/Downloader/ArchiveDownloader.php | 4 ++-- src/Composer/Downloader/RarDownloader.php | 2 +- src/Composer/Downloader/ZipDownloader.php | 8 ++++---- src/Composer/Factory.php | 2 +- src/Composer/Installer/InstallationManager.php | 1 - src/Composer/Installer/SuggestedPackagesReporter.php | 10 +++++----- src/Composer/Package/AliasPackage.php | 6 +++--- src/Composer/Package/Archiver/ArchiveManager.php | 1 - src/Composer/Package/CompleteAliasPackage.php | 4 ++-- src/Composer/Package/CompletePackageInterface.php | 4 +--- src/Composer/Package/Link.php | 6 +++--- src/Composer/Package/Loader/ArrayLoader.php | 2 +- src/Composer/Package/Loader/RootPackageLoader.php | 2 -- src/Composer/Package/RootAliasPackage.php | 4 ++-- src/Composer/Plugin/PluginManager.php | 10 +++++----- src/Composer/Plugin/PostFileDownloadEvent.php | 12 ++++++------ src/Composer/Repository/FilesystemRepository.php | 1 - src/Composer/Repository/RepositoryInterface.php | 4 ++-- src/Composer/Repository/Vcs/GitLabDriver.php | 1 + src/Composer/Util/Filesystem.php | 2 +- src/Composer/Util/PackageSorter.php | 1 - src/Composer/Util/Platform.php | 3 +-- src/Composer/Util/ProcessExecutor.php | 4 ++++ tests/Composer/Test/Command/InitCommandTest.php | 1 - tests/Composer/Test/Downloader/ZipDownloaderTest.php | 1 - tests/Composer/Test/Mock/InstallationManagerMock.php | 1 - 35 files changed, 62 insertions(+), 71 deletions(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 233ce4402..f824d6516 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -133,7 +133,7 @@ EOT $options['autoload'] = (object) array( 'psr-4' => array( $namespace . '\\' => $autoloadPath, - ) + ), ); } @@ -444,7 +444,6 @@ EOT $autoload ); $input->setOption('autoload', $autoload); - } /** @@ -673,9 +672,10 @@ EOT } $namespace = array_map( - function($part) { + function ($part) { $part = preg_replace('/[^a-z0-9]/i', ' ', $part); $part = ucwords($part); + return str_replace(' ', '', $part); }, explode('/', $packageName) diff --git a/src/Composer/Command/ReinstallCommand.php b/src/Composer/Command/ReinstallCommand.php index c96965019..1d4da3a96 100644 --- a/src/Composer/Command/ReinstallCommand.php +++ b/src/Composer/Command/ReinstallCommand.php @@ -91,6 +91,7 @@ EOT if (!$packagesToReinstall) { $io->writeError('Found no packages to reinstall, aborting.'); + return 1; } diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 5ecee108f..807e24067 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -36,13 +36,11 @@ use Composer\Repository\RootPackageRepository; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Semver; use Composer\Spdx\SpdxLicenses; -use Composer\Util\Platform; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Terminal; /** * @author Robert Schönthal diff --git a/src/Composer/DependencyResolver/GenericRule.php b/src/Composer/DependencyResolver/GenericRule.php index 9441ada77..10ea9c335 100644 --- a/src/Composer/DependencyResolver/GenericRule.php +++ b/src/Composer/DependencyResolver/GenericRule.php @@ -23,8 +23,8 @@ class GenericRule extends Rule protected $literals; /** - * @param array $literals - * @param int|null $reason A RULE_* constant describing the reason for generating this rule + * @param array $literals + * @param int|null $reason A RULE_* constant describing the reason for generating this rule * @param Link|BasePackage|int|null $reasonData */ public function __construct(array $literals, $reason, $reasonData) diff --git a/src/Composer/DependencyResolver/MultiConflictRule.php b/src/Composer/DependencyResolver/MultiConflictRule.php index e5be1f1ec..262f34504 100644 --- a/src/Composer/DependencyResolver/MultiConflictRule.php +++ b/src/Composer/DependencyResolver/MultiConflictRule.php @@ -25,8 +25,8 @@ class MultiConflictRule extends Rule protected $literals; /** - * @param array $literals - * @param int $reason A RULE_* constant describing the reason for generating this rule + * @param array $literals + * @param int $reason A RULE_* constant describing the reason for generating this rule * @param Link|BasePackage $reasonData */ public function __construct(array $literals, $reason, $reasonData) diff --git a/src/Composer/DependencyResolver/Problem.php b/src/Composer/DependencyResolver/Problem.php index 02af0aa8d..5248dbadf 100644 --- a/src/Composer/DependencyResolver/Problem.php +++ b/src/Composer/DependencyResolver/Problem.php @@ -441,7 +441,7 @@ class Problem if ($topPackage instanceof RootPackageInterface) { return array( "- Root composer.json requires $packageName".self::constraintToText($constraint).', it is ', - 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose).' from '.$nextRepo->getRepoName().' but '.$topPackage->getPrettyName().' is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.' + 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose).' from '.$nextRepo->getRepoName().' but '.$topPackage->getPrettyName().' is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.', ); } } @@ -450,7 +450,7 @@ class Problem $singular = count($higherRepoPackages) === 1; return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', it is ', - 'found '.self::getPackageList($nextRepoPackages, $isVerbose).' in the lock file and '.self::getPackageList($higherRepoPackages, $isVerbose).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' but ' . ($singular ? 'it does' : 'these do') . ' not match your '.$reason.' and ' . ($singular ? 'is' : 'are') . ' therefore not installable. Make sure you either fix the '.$reason.' or avoid updating this package to keep the one from the lock file.'); + 'found '.self::getPackageList($nextRepoPackages, $isVerbose).' in the lock file and '.self::getPackageList($higherRepoPackages, $isVerbose).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' but ' . ($singular ? 'it does' : 'these do') . ' not match your '.$reason.' and ' . ($singular ? 'is' : 'are') . ' therefore not installable. Make sure you either fix the '.$reason.' or avoid updating this package to keep the one from the lock file.', ); } return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', it is ', 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose).' from '.$nextRepo->getRepoName().' but '.self::getPackageList($higherRepoPackages, $isVerbose).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' has higher repository priority. The packages with higher priority do not match your '.$reason.' and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.'); diff --git a/src/Composer/DependencyResolver/Rule.php b/src/Composer/DependencyResolver/Rule.php index 86abe994f..4eb9f7dd7 100644 --- a/src/Composer/DependencyResolver/Rule.php +++ b/src/Composer/DependencyResolver/Rule.php @@ -243,7 +243,6 @@ abstract class Rule } } - return $package2->getPrettyString().' conflicts with '.$conflictTarget.'.'; case self::RULE_PACKAGE_REQUIRES: diff --git a/src/Composer/DependencyResolver/Rule2Literals.php b/src/Composer/DependencyResolver/Rule2Literals.php index 4d6b86c50..6a3eb7c94 100644 --- a/src/Composer/DependencyResolver/Rule2Literals.php +++ b/src/Composer/DependencyResolver/Rule2Literals.php @@ -24,9 +24,9 @@ class Rule2Literals extends Rule protected $literal2; /** - * @param int $literal1 - * @param int $literal2 - * @param int $reason A RULE_* constant describing the reason for generating this rule + * @param int $literal1 + * @param int $literal2 + * @param int $reason A RULE_* constant describing the reason for generating this rule * @param Link|BasePackage $reasonData */ public function __construct($literal1, $literal2, $reason, $reasonData) diff --git a/src/Composer/DependencyResolver/RuleSetGenerator.php b/src/Composer/DependencyResolver/RuleSetGenerator.php index 26977e567..d9da5e062 100644 --- a/src/Composer/DependencyResolver/RuleSetGenerator.php +++ b/src/Composer/DependencyResolver/RuleSetGenerator.php @@ -44,9 +44,9 @@ class RuleSetGenerator * @param BasePackage $package The package with a requirement * @param array $providers The providers of the requirement * @param int $reason A RULE_* constant describing the - * reason for generating this rule + * reason for generating this rule * @param mixed $reasonData Any data, e.g. the requirement name, - * that goes with the reason + * that goes with the reason * @return Rule|null The generated rule or null if tautological */ protected function createRequireRule(BasePackage $package, array $providers, $reason, $reasonData = null) @@ -95,9 +95,9 @@ class RuleSetGenerator * @param BasePackage $issuer The package declaring the conflict * @param BasePackage $provider The package causing the conflict * @param int $reason A RULE_* constant describing the - * reason for generating this rule + * reason for generating this rule * @param mixed $reasonData Any data, e.g. the package name, that - * goes with the reason + * goes with the reason * @return Rule|null The generated rule */ protected function createRule2Literals(BasePackage $issuer, BasePackage $provider, $reason, $reasonData = null) diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php index 27b86cf9d..7788397f2 100644 --- a/src/Composer/Downloader/ArchiveDownloader.php +++ b/src/Composer/Downloader/ArchiveDownloader.php @@ -115,8 +115,8 @@ abstract class ArchiveDownloader extends FileDownloader * that the source directory gets merged into the target one if the target exists. Otherwise rename() by default would * put the source into the target e.g. src/ => target/src/ (assuming target exists) instead of src/ => target/ * - * @param string $from Directory - * @param string $to Directory + * @param string $from Directory + * @param string $to Directory * @return void */ $renameRecursively = function ($from, $to) use ($filesystem, $getFolderContent, $package, &$renameRecursively) { diff --git a/src/Composer/Downloader/RarDownloader.php b/src/Composer/Downloader/RarDownloader.php index ac61c9917..e11366421 100644 --- a/src/Composer/Downloader/RarDownloader.php +++ b/src/Composer/Downloader/RarDownloader.php @@ -77,5 +77,5 @@ class RarDownloader extends ArchiveDownloader $rarArchive->close(); return \React\Promise\resolve(); - } + } } diff --git a/src/Composer/Downloader/ZipDownloader.php b/src/Composer/Downloader/ZipDownloader.php index 694ad7cc3..4475c5e8f 100644 --- a/src/Composer/Downloader/ZipDownloader.php +++ b/src/Composer/Downloader/ZipDownloader.php @@ -76,8 +76,8 @@ class ZipDownloader extends ArchiveDownloader /** * extract $file to $path with "unzip" command * - * @param string $file File to extract - * @param string $path Path where to extract file + * @param string $file File to extract + * @param string $path Path where to extract file * @return PromiseInterface */ private function extractWithSystemUnzip(PackageInterface $package, $file, $path) @@ -136,8 +136,8 @@ class ZipDownloader extends ArchiveDownloader /** * extract $file to $path with ZipArchive * - * @param string $file File to extract - * @param string $path Path where to extract file + * @param string $file File to extract + * @param string $path Path where to extract file * @return PromiseInterface * * TODO v3 should make this private once we can drop PHP 5.3 support diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index aa89f0cf8..a7ba027c1 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -126,7 +126,7 @@ class Factory if (is_dir($home . '/cache') && !is_dir($userDir . '/Library/Caches/composer')) { Silencer::call('rename', $home . '/cache', $userDir . '/Library/Caches/composer'); } - + return $userDir . '/Library/Caches/composer'; } diff --git a/src/Composer/Installer/InstallationManager.php b/src/Composer/Installer/InstallationManager.php index 50c31e595..fb3e28f78 100644 --- a/src/Composer/Installer/InstallationManager.php +++ b/src/Composer/Installer/InstallationManager.php @@ -16,7 +16,6 @@ use Composer\IO\IOInterface; use Composer\IO\ConsoleIO; use Composer\Package\PackageInterface; use Composer\Package\AliasPackage; -use Composer\Repository\RepositoryInterface; use Composer\Repository\InstalledRepositoryInterface; use Composer\DependencyResolver\Operation\OperationInterface; use Composer\DependencyResolver\Operation\InstallOperation; diff --git a/src/Composer/Installer/SuggestedPackagesReporter.php b/src/Composer/Installer/SuggestedPackagesReporter.php index 5e905cd7c..0e28e9d50 100644 --- a/src/Composer/Installer/SuggestedPackagesReporter.php +++ b/src/Composer/Installer/SuggestedPackagesReporter.php @@ -98,9 +98,9 @@ class SuggestedPackagesReporter * * Do not list the ones already installed if installed repository provided. * - * @param int $mode One of the MODE_* constants from this class - * @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped - * @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown + * @param int $mode One of the MODE_* constants from this class + * @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped + * @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown * @return void */ public function output($mode, InstalledRepository $installedRepo = null, PackageInterface $onlyDependentsOf = null) @@ -165,8 +165,8 @@ class SuggestedPackagesReporter /** * Output number of new suggested packages and a hint to use suggest command. * - * @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped - * @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown + * @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped + * @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown * @return void */ public function outputMinimalistic(InstalledRepository $installedRepo = null, PackageInterface $onlyDependentsOf = null) diff --git a/src/Composer/Package/AliasPackage.php b/src/Composer/Package/AliasPackage.php index 2e5d757bc..42d38b6b6 100644 --- a/src/Composer/Package/AliasPackage.php +++ b/src/Composer/Package/AliasPackage.php @@ -43,9 +43,9 @@ class AliasPackage extends BasePackage /** * All descendants' constructors should call this parent constructor * - * @param BasePackage $aliasOf The package this package is an alias of - * @param string $version The version the alias must report - * @param string $prettyVersion The alias's non-normalized version + * @param BasePackage $aliasOf The package this package is an alias of + * @param string $version The version the alias must report + * @param string $prettyVersion The alias's non-normalized version */ public function __construct(BasePackage $aliasOf, $version, $prettyVersion) { diff --git a/src/Composer/Package/Archiver/ArchiveManager.php b/src/Composer/Package/Archiver/ArchiveManager.php index 14db48dd6..3025878d7 100644 --- a/src/Composer/Package/Archiver/ArchiveManager.php +++ b/src/Composer/Package/Archiver/ArchiveManager.php @@ -13,7 +13,6 @@ namespace Composer\Package\Archiver; use Composer\Downloader\DownloadManager; -use Composer\Package\PackageInterface; use Composer\Package\RootPackageInterface; use Composer\Util\Filesystem; use Composer\Util\Loop; diff --git a/src/Composer/Package/CompleteAliasPackage.php b/src/Composer/Package/CompleteAliasPackage.php index 6326eedbc..5c9e340f3 100644 --- a/src/Composer/Package/CompleteAliasPackage.php +++ b/src/Composer/Package/CompleteAliasPackage.php @@ -24,8 +24,8 @@ class CompleteAliasPackage extends AliasPackage implements CompletePackageInterf * All descendants' constructors should call this parent constructor * * @param CompletePackage $aliasOf The package this package is an alias of - * @param string $version The version the alias must report - * @param string $prettyVersion The alias's non-normalized version + * @param string $version The version the alias must report + * @param string $prettyVersion The alias's non-normalized version */ public function __construct(CompletePackage $aliasOf, $version, $prettyVersion) { diff --git a/src/Composer/Package/CompletePackageInterface.php b/src/Composer/Package/CompletePackageInterface.php index 595338296..0d9425496 100644 --- a/src/Composer/Package/CompletePackageInterface.php +++ b/src/Composer/Package/CompletePackageInterface.php @@ -27,7 +27,7 @@ interface CompletePackageInterface extends PackageInterface public function getScripts(); /** - * @param array $scripts + * @param array $scripts * @return void */ public function setScripts(array $scripts); @@ -205,6 +205,4 @@ interface CompletePackageInterface extends PackageInterface * @return void */ public function setArchiveExcludes(array $excludes); - - } diff --git a/src/Composer/Package/Link.php b/src/Composer/Package/Link.php index 8b0eab07f..955eb8e97 100644 --- a/src/Composer/Package/Link.php +++ b/src/Composer/Package/Link.php @@ -77,9 +77,9 @@ class Link * * @param string $source * @param string $target - * @param ConstraintInterface $constraint Constraint applying to the target of this link - * @param self::TYPE_* $description Used to create a descriptive string representation - * @param string|null $prettyConstraint + * @param ConstraintInterface $constraint Constraint applying to the target of this link + * @param self::TYPE_* $description Used to create a descriptive string representation + * @param string|null $prettyConstraint */ public function __construct( $source, diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index d8a69b76a..1f3843f3e 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -80,7 +80,7 @@ class ArrayLoader implements LoaderInterface /** * @template PackageClass of CompletePackageInterface * @param array $versions - * @param string $class FQCN to be instantiated + * @param string $class FQCN to be instantiated * @return list * @phpstan-param class-string $class */ diff --git a/src/Composer/Package/Loader/RootPackageLoader.php b/src/Composer/Package/Loader/RootPackageLoader.php index 0e59d1750..f2e7ebf86 100644 --- a/src/Composer/Package/Loader/RootPackageLoader.php +++ b/src/Composer/Package/Loader/RootPackageLoader.php @@ -13,11 +13,9 @@ namespace Composer\Package\Loader; use Composer\Package\BasePackage; -use Composer\Package\AliasPackage; use Composer\Config; use Composer\IO\IOInterface; use Composer\Package\Package; -use Composer\Package\RootPackageInterface; use Composer\Package\RootAliasPackage; use Composer\Repository\RepositoryFactory; use Composer\Package\Version\VersionGuesser; diff --git a/src/Composer/Package/RootAliasPackage.php b/src/Composer/Package/RootAliasPackage.php index c6c8c1847..6a71ba740 100644 --- a/src/Composer/Package/RootAliasPackage.php +++ b/src/Composer/Package/RootAliasPackage.php @@ -24,8 +24,8 @@ class RootAliasPackage extends CompleteAliasPackage implements RootPackageInterf * All descendants' constructors should call this parent constructor * * @param RootPackageInterface $aliasOf The package this package is an alias of - * @param string $version The version the alias must report - * @param string $prettyVersion The alias's non-normalized version + * @param string $version The version the alias must report + * @param string $prettyVersion The alias's non-normalized version */ public function __construct(RootPackageInterface $aliasOf, $version, $prettyVersion) { diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index e58bf28f9..cd85ac2d3 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -477,7 +477,7 @@ class PluginManager /** * @template CapabilityClass of Capability - * @param PluginInterface $plugin + * @param PluginInterface $plugin * @param class-string $capabilityClassName The fully qualified name of the API interface which the plugin may provide * an implementation of. * @param array $ctorArgs Arguments passed to Capability's constructor. @@ -509,12 +509,12 @@ class PluginManager return null; } - /** + /** * @template CapabilityClass of Capability * @param class-string $capabilityClassName The fully qualified name of the API interface which the plugin may provide - * an implementation of. - * @param array $ctorArgs Arguments passed to Capability's constructor. - * Keeping it an array will allow future values to be passed w\o changing the signature. + * an implementation of. + * @param array $ctorArgs Arguments passed to Capability's constructor. + * Keeping it an array will allow future values to be passed w\o changing the signature. * @return CapabilityClass[] */ public function getPluginCapabilities($capabilityClassName, array $ctorArgs = array()) diff --git a/src/Composer/Plugin/PostFileDownloadEvent.php b/src/Composer/Plugin/PostFileDownloadEvent.php index 665bce128..c30e00c89 100644 --- a/src/Composer/Plugin/PostFileDownloadEvent.php +++ b/src/Composer/Plugin/PostFileDownloadEvent.php @@ -50,12 +50,12 @@ class PostFileDownloadEvent extends Event /** * Constructor. * - * @param string $name The event name - * @param string|null $fileName The file name - * @param string|null $checksum The checksum - * @param string $url The processed url - * @param string $type The type (package or metadata). - * @param mixed $context Additional context for the download. + * @param string $name The event name + * @param string|null $fileName The file name + * @param string|null $checksum The checksum + * @param string $url The processed url + * @param string $type The type (package or metadata). + * @param mixed $context Additional context for the download. */ public function __construct($name, $fileName, $checksum, $url, $type, $context = null) { diff --git a/src/Composer/Repository/FilesystemRepository.php b/src/Composer/Repository/FilesystemRepository.php index a80777033..696b00541 100644 --- a/src/Composer/Repository/FilesystemRepository.php +++ b/src/Composer/Repository/FilesystemRepository.php @@ -14,7 +14,6 @@ namespace Composer\Repository; use Composer\Json\JsonFile; use Composer\Package\Loader\ArrayLoader; -use Composer\Package\PackageInterface; use Composer\Package\RootPackageInterface; use Composer\Package\AliasPackage; use Composer\Package\Dumper\ArrayDumper; diff --git a/src/Composer/Repository/RepositoryInterface.php b/src/Composer/Repository/RepositoryInterface.php index 698a8d1a9..4223d12fb 100644 --- a/src/Composer/Repository/RepositoryInterface.php +++ b/src/Composer/Repository/RepositoryInterface.php @@ -72,8 +72,8 @@ interface RepositoryInterface extends \Countable * * @param ConstraintInterface[] $packageNameMap package names pointing to constraints * @param array $acceptableStabilities array of stability => BasePackage::STABILITY_* value - * @param array $stabilityFlags an array of package name => BasePackage::STABILITY_* value - * @param array> $alreadyLoaded an array of package name => package version => package + * @param array $stabilityFlags an array of package name => BasePackage::STABILITY_* value + * @param array> $alreadyLoaded an array of package name => package version => package * * @return array{namesFound: string[], packages: PackageInterface[]} */ diff --git a/src/Composer/Repository/Vcs/GitLabDriver.php b/src/Composer/Repository/Vcs/GitLabDriver.php index 9ed413b11..2bc0cf61c 100644 --- a/src/Composer/Repository/Vcs/GitLabDriver.php +++ b/src/Composer/Repository/Vcs/GitLabDriver.php @@ -228,6 +228,7 @@ class GitLabDriver extends VcsDriver if ($this->protocol) { return $this->project["{$this->protocol}_url_to_repo"]; } + return $this->isPrivate ? $this->project['ssh_url_to_repo'] : $this->project['http_url_to_repo']; } diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index 8335052c7..6b1da6a52 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -606,7 +606,7 @@ class Filesystem * This will also check for readability by reading the file as is_readable can not be trusted on network-mounts * and \\wsl$ paths. See https://github.com/composer/composer/issues/8231 and https://bugs.php.net/bug.php?id=68926 * - * @param string $path + * @param string $path * @return bool */ public static function isReadable($path) diff --git a/src/Composer/Util/PackageSorter.php b/src/Composer/Util/PackageSorter.php index ac20b106e..df2d89a4b 100644 --- a/src/Composer/Util/PackageSorter.php +++ b/src/Composer/Util/PackageSorter.php @@ -12,7 +12,6 @@ namespace Composer\Util; -use Composer\Package\Link; use Composer\Package\PackageInterface; class PackageSorter diff --git a/src/Composer/Util/Platform.php b/src/Composer/Util/Platform.php index c2bbbf365..75b0b06eb 100644 --- a/src/Composer/Util/Platform.php +++ b/src/Composer/Util/Platform.php @@ -42,7 +42,6 @@ class Platform * putenv('X') equivalent but updates the runtime global variables too * * @param string $name - * @param string $value * @return void */ public static function clearEnv($name) @@ -103,7 +102,7 @@ class Platform { if (null === self::$isWindowsSubsystemForLinux) { self::$isWindowsSubsystemForLinux = false; - + // while WSL will be hosted within windows, WSL itself cannot be windows based itself. if (self::isWindows()) { return self::$isWindowsSubsystemForLinux = false; diff --git a/src/Composer/Util/ProcessExecutor.php b/src/Composer/Util/ProcessExecutor.php index 1922e6c1b..7d7e6546e 100644 --- a/src/Composer/Util/ProcessExecutor.php +++ b/src/Composer/Util/ProcessExecutor.php @@ -260,9 +260,11 @@ class ProcessExecutor } } catch (\Exception $e) { call_user_func($job['reject'], $e); + return; } catch (\Throwable $e) { call_user_func($job['reject'], $e); + return; } @@ -272,9 +274,11 @@ class ProcessExecutor $process->start(); } catch (\Exception $e) { call_user_func($job['reject'], $e); + return; } catch (\Throwable $e) { call_user_func($job['reject'], $e); + return; } } diff --git a/tests/Composer/Test/Command/InitCommandTest.php b/tests/Composer/Test/Command/InitCommandTest.php index d8c7e50eb..1c2014195 100644 --- a/tests/Composer/Test/Command/InitCommandTest.php +++ b/tests/Composer/Test/Command/InitCommandTest.php @@ -113,5 +113,4 @@ class InitCommandTest extends TestCase $namespace = $command->namespaceFromPackageName(null); $this->assertNull($namespace); } - } diff --git a/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index 986c46e4a..9c9c974fd 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -85,7 +85,6 @@ class ZipDownloaderTest extends TestCase $downloader = new ZipDownloader($this->io, $this->config, $this->httpDownloader); - try { $loop = new Loop($this->httpDownloader); $promise = $downloader->download($this->package, $path = sys_get_temp_dir().'/composer-zip-test'); diff --git a/tests/Composer/Test/Mock/InstallationManagerMock.php b/tests/Composer/Test/Mock/InstallationManagerMock.php index 7898250cc..46b115771 100644 --- a/tests/Composer/Test/Mock/InstallationManagerMock.php +++ b/tests/Composer/Test/Mock/InstallationManagerMock.php @@ -13,7 +13,6 @@ namespace Composer\Test\Mock; use Composer\Installer\InstallationManager; -use Composer\Repository\RepositoryInterface; use Composer\Repository\InstalledRepositoryInterface; use Composer\Package\PackageInterface; use Composer\IO\IOInterface;