From c10854d3f32343b37ae9be926dba421b26423a68 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 31 Aug 2022 12:26:58 +0200 Subject: [PATCH] Remove extra lines --- src/Composer/Cache.php | 2 -- src/Composer/Command/BaseCommand.php | 1 - src/Composer/Compiler.php | 1 - src/Composer/Downloader/ArchiveDownloader.php | 2 -- src/Composer/Downloader/VcsDownloader.php | 3 --- src/Composer/IO/IOInterface.php | 1 - src/Composer/Installer.php | 2 -- src/Composer/Json/JsonFormatter.php | 1 - src/Composer/Package/Loader/RootPackageLoader.php | 1 - src/Composer/Package/Locker.php | 1 - src/Composer/Package/Package.php | 2 -- src/Composer/Package/PackageInterface.php | 1 - src/Composer/Plugin/PluginInterface.php | 3 --- src/Composer/Plugin/PluginManager.php | 6 ------ src/Composer/Util/Filesystem.php | 4 ---- src/Composer/Util/Http/ProxyHelper.php | 1 - src/Composer/Util/NoProxyPattern.php | 4 ---- tests/Composer/Test/TestCase.php | 2 -- tests/Composer/Test/Util/AuthHelperTest.php | 1 - 19 files changed, 39 deletions(-) diff --git a/src/Composer/Cache.php b/src/Composer/Cache.php index eddc402f2..8a5ab1a71 100644 --- a/src/Composer/Cache.php +++ b/src/Composer/Cache.php @@ -174,7 +174,6 @@ class Cache /** * Copy a file into the cache * - * * @return bool */ public function copyFrom(string $file, string $source) @@ -198,7 +197,6 @@ class Cache /** * Copy a file out of the cache * - * * @return bool */ public function copyTo(string $file, string $target) diff --git a/src/Composer/Command/BaseCommand.php b/src/Composer/Command/BaseCommand.php index b83fb00c4..a33f3a5b3 100644 --- a/src/Composer/Command/BaseCommand.php +++ b/src/Composer/Command/BaseCommand.php @@ -282,7 +282,6 @@ abstract class BaseCommand extends Command /** * Returns preferSource and preferDist values based on the configuration. * - * * @return bool[] An array composed of the preferSource and preferDist values */ protected function getPreferredInstallOptions(Config $config, InputInterface $input, bool $keepVcsRequiresPreferSource = false) diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 53c252b03..14449a13e 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -40,7 +40,6 @@ class Compiler * * @param string $pharFile The full path to the file to create * - * * @throws \RuntimeException */ public function compile(string $pharFile = 'composer.phar'): void diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php index c31ac31ea..db8c04391 100644 --- a/src/Composer/Downloader/ArchiveDownloader.php +++ b/src/Composer/Downloader/ArchiveDownloader.php @@ -49,8 +49,6 @@ abstract class ArchiveDownloader extends FileDownloader /** * @inheritDoc * - * - * * @throws \RuntimeException * @throws \UnexpectedValueException */ diff --git a/src/Composer/Downloader/VcsDownloader.php b/src/Composer/Downloader/VcsDownloader.php index de67d16ee..15f3aeccd 100644 --- a/src/Composer/Downloader/VcsDownloader.php +++ b/src/Composer/Downloader/VcsDownloader.php @@ -258,7 +258,6 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa * @param bool $update if true (update) the changes can be stashed and reapplied after an update, * if false (remove) the changes should be assumed to be lost if the operation is not aborted * - * * @throws \RuntimeException in case the operation must be aborted */ protected function cleanChanges(PackageInterface $package, string $path, bool $update): PromiseInterface @@ -274,8 +273,6 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa /** * Reapply previously stashes changes if applicable, only called after an update (regardless if successful or not) * - * - * * @throws \RuntimeException in case the operation must be aborted or the patch does not apply cleanly */ protected function reapplyChanges(string $path): void diff --git a/src/Composer/IO/IOInterface.php b/src/Composer/IO/IOInterface.php index fb9906c08..91c239ff4 100644 --- a/src/Composer/IO/IOInterface.php +++ b/src/Composer/IO/IOInterface.php @@ -234,7 +234,6 @@ interface IOInterface extends LoggerInterface /** * Loads authentications from a config instance * - * * @return void */ public function loadConfiguration(Config $config); diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 09beafaea..38708c496 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -625,7 +625,6 @@ class Installer * * @param array> $aliases * - * * @phpstan-param list $aliases * @phpstan-return self::ERROR_* */ @@ -811,7 +810,6 @@ class Installer /** * @param array> $rootAliases * - * * @phpstan-param list $rootAliases */ private function createRepositorySet(bool $forUpdate, PlatformRepository $platformRepo, array $rootAliases = [], ?RepositoryInterface $lockedRepository = null): RepositorySet diff --git a/src/Composer/Json/JsonFormatter.php b/src/Composer/Json/JsonFormatter.php index 773ac886e..633d2c399 100644 --- a/src/Composer/Json/JsonFormatter.php +++ b/src/Composer/Json/JsonFormatter.php @@ -32,7 +32,6 @@ class JsonFormatter * * Originally licensed under MIT by Dave Perrett * - * * @param bool $unescapeUnicode Un escape unicode * @param bool $unescapeSlashes Un escape slashes */ diff --git a/src/Composer/Package/Loader/RootPackageLoader.php b/src/Composer/Package/Loader/RootPackageLoader.php index 588a72787..ffb553671 100644 --- a/src/Composer/Package/Loader/RootPackageLoader.php +++ b/src/Composer/Package/Loader/RootPackageLoader.php @@ -61,7 +61,6 @@ class RootPackageLoader extends ArrayLoader /** * @inheritDoc * - * * @return RootPackage|RootAliasPackage * * @phpstan-param class-string $class diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index e5c97cce0..4a7cb14c8 100644 --- a/src/Composer/Package/Locker.php +++ b/src/Composer/Package/Locker.php @@ -339,7 +339,6 @@ class Locker * @param array $platformOverrides * @param bool $write Whether to actually write data to disk, useful in tests and for --dry-run * - * * @phpstan-param list $aliases */ public function setLockData(array $packages, ?array $devPackages, array $platformReqs, array $platformDevReqs, array $aliases, string $minimumStability, array $stabilityFlags, bool $preferStable, bool $preferLowest, array $platformOverrides, bool $write = true): bool diff --git a/src/Composer/Package/Package.php b/src/Composer/Package/Package.php index dd6bf4986..76adb92bc 100644 --- a/src/Composer/Package/Package.php +++ b/src/Composer/Package/Package.php @@ -537,7 +537,6 @@ class Package extends BasePackage * * @param array $autoload Mapping of autoloading rules * - * * @phpstan-param AutoloadRules $autoload */ public function setAutoload(array $autoload): void @@ -558,7 +557,6 @@ class Package extends BasePackage * * @param array $devAutoload Mapping of dev autoloading rules * - * * @phpstan-param DevAutoloadRules $devAutoload */ public function setDevAutoload(array $devAutoload): void diff --git a/src/Composer/Package/PackageInterface.php b/src/Composer/Package/PackageInterface.php index c6196dafe..b65d570a1 100644 --- a/src/Composer/Package/PackageInterface.php +++ b/src/Composer/Package/PackageInterface.php @@ -234,7 +234,6 @@ interface PackageInterface /** * Returns the stability of this package: one of (dev, alpha, beta, RC, stable) * - * * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' */ public function getStability(): string; diff --git a/src/Composer/Plugin/PluginInterface.php b/src/Composer/Plugin/PluginInterface.php index 51f22a061..8ceb4825d 100644 --- a/src/Composer/Plugin/PluginInterface.php +++ b/src/Composer/Plugin/PluginInterface.php @@ -37,7 +37,6 @@ interface PluginInterface /** * Apply plugin modifications to Composer * - * * @return void */ public function activate(Composer $composer, IOInterface $io); @@ -49,7 +48,6 @@ interface PluginInterface * uninstalled, but also before it gets upgraded to a new version * so the old one can be deactivated and the new one activated. * - * * @return void */ public function deactivate(Composer $composer, IOInterface $io); @@ -59,7 +57,6 @@ interface PluginInterface * * This will be called after deactivate. * - * * @return void */ public function uninstall(Composer $composer, IOInterface $io); diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index 2a024d986..fbde18b00 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -148,7 +148,6 @@ class PluginManager * @param bool $failOnMissingClasses By default this silently skips plugins that can not be found, but if set to true it fails with an exception * @param bool $isGlobalPlugin Set to true to denote plugins which are installed in the global Composer directory * - * * @throws \UnexpectedValueException */ public function registerPackage(PackageInterface $package, bool $failOnMissingClasses = false, bool $isGlobalPlugin = false): void @@ -304,8 +303,6 @@ class PluginManager * If it's of type composer-installer it is unregistered from the installers * instead for BC * - * - * * @throws \UnexpectedValueException */ public function deactivatePackage(PackageInterface $package): void @@ -329,8 +326,6 @@ class PluginManager * If it's of type composer-installer it is unregistered from the installers * instead for BC * - * - * * @throws \UnexpectedValueException */ public function uninstallPackage(PackageInterface $package): void @@ -446,7 +441,6 @@ class PluginManager * * @param RepositoryInterface $repo Repository to scan for plugins to install * - * * @throws \RuntimeException */ private function loadRepository(RepositoryInterface $repo, bool $isGlobalRepo): void diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index 92cc0af11..419d62be4 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -324,7 +324,6 @@ class Filesystem * Some systems can't rename and also don't have proc_open, * which requires this solution. * - * * @return void */ public function copyThenRemove(string $source, string $target) @@ -716,7 +715,6 @@ class Filesystem /** * return true if that directory is a symlink. * - * * @return bool */ public function isSymlinkedDirectory(string $directory) @@ -762,7 +760,6 @@ class Filesystem /** * Creates an NTFS junction. * - * * @return void */ public function junction(string $target, string $junction) @@ -857,7 +854,6 @@ class Filesystem /** * Copy file using stream_copy_to_stream to work around https://bugs.php.net/bug.php?id=6463 * - * * @return void */ public function safeCopy(string $source, string $target) diff --git a/src/Composer/Util/Http/ProxyHelper.php b/src/Composer/Util/Http/ProxyHelper.php index be4711bf9..58056e429 100644 --- a/src/Composer/Util/Http/ProxyHelper.php +++ b/src/Composer/Util/Http/ProxyHelper.php @@ -60,7 +60,6 @@ class ProxyHelper /** * Returns http context options for the proxy url * - * * @return array{http: array{proxy: string, header?: string}} */ public static function getContextOptions(string $proxyUrl): array diff --git a/src/Composer/Util/NoProxyPattern.php b/src/Composer/Util/NoProxyPattern.php index ebba75369..45f47343e 100644 --- a/src/Composer/Util/NoProxyPattern.php +++ b/src/Composer/Util/NoProxyPattern.php @@ -69,7 +69,6 @@ class NoProxyPattern /** * Returns false is the url cannot be parsed, otherwise a data object * - * * @return bool|stdClass */ protected function getUrlData(string $url) @@ -165,7 +164,6 @@ class NoProxyPattern /** * Finds or creates rule data for a hostname * - * * @return null|stdClass Null if the hostname is invalid */ private function getRule(int $index, string $hostName): ?stdClass @@ -239,7 +237,6 @@ class NoProxyPattern * IPv4 addresses are always mapped to IPv6, which simplifies handling * and comparison. * - * * @return mixed[] in_addr, size */ private function ipGetAddr(string $host): array @@ -355,7 +352,6 @@ class NoProxyPattern /** * Splits the hostname into host and port components * - * * @return mixed[] host, port, if there was error */ private function splitHostPort(string $hostName): array diff --git a/tests/Composer/Test/TestCase.php b/tests/Composer/Test/TestCase.php index 0b2121114..9d0aae57a 100644 --- a/tests/Composer/Test/TestCase.php +++ b/tests/Composer/Test/TestCase.php @@ -308,7 +308,6 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase * * @param string $executableName The name of the binary to test. * - * * @throws \PHPUnit\Framework\SkippedTestError */ protected function skipIfNotExecutable(string $executableName): void @@ -326,7 +325,6 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase /** * Transforms an escaped non-Windows command to match Windows escaping. * - * * @return string The transformed command */ protected function getCmd(string $cmd): string diff --git a/tests/Composer/Test/Util/AuthHelperTest.php b/tests/Composer/Test/Util/AuthHelperTest.php index a23e985a8..4f1495d68 100644 --- a/tests/Composer/Test/Util/AuthHelperTest.php +++ b/tests/Composer/Test/Util/AuthHelperTest.php @@ -541,7 +541,6 @@ class AuthHelperTest extends TestCase /** * @param array $auth * - * * @phpstan-param array{username: string|null, password: string|null} $auth */ private function expectsAuthentication(string $origin, array $auth): void