From fd2972247fd00c8289580d4958a44a533c87aaf8 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 18 Mar 2022 14:45:59 +0100 Subject: [PATCH] Add missing param types, fixes #10638 --- src/Composer/Installer/LibraryInstaller.php | 2 +- src/Composer/Installer/MetapackageInstaller.php | 2 +- src/Composer/Installer/NoopInstaller.php | 2 +- src/Composer/Installer/PluginInstaller.php | 2 +- src/Composer/Package/Archiver/PharArchiver.php | 4 ++-- src/Composer/Package/Archiver/ZipArchiver.php | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index 460034c52..925839f53 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -71,7 +71,7 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface /** * @inheritDoc */ - public function supports($packageType) + public function supports(string $packageType) { return $packageType === $this->type || null === $this->type; } diff --git a/src/Composer/Installer/MetapackageInstaller.php b/src/Composer/Installer/MetapackageInstaller.php index feff8d99a..ec437a89a 100644 --- a/src/Composer/Installer/MetapackageInstaller.php +++ b/src/Composer/Installer/MetapackageInstaller.php @@ -37,7 +37,7 @@ class MetapackageInstaller implements InstallerInterface /** * @inheritDoc */ - public function supports($packageType) + public function supports(string $packageType) { return $packageType === 'metapackage'; } diff --git a/src/Composer/Installer/NoopInstaller.php b/src/Composer/Installer/NoopInstaller.php index 3d3c474c5..2af994985 100644 --- a/src/Composer/Installer/NoopInstaller.php +++ b/src/Composer/Installer/NoopInstaller.php @@ -27,7 +27,7 @@ class NoopInstaller implements InstallerInterface /** * @inheritDoc */ - public function supports($packageType) + public function supports(string $packageType) { return true; } diff --git a/src/Composer/Installer/PluginInstaller.php b/src/Composer/Installer/PluginInstaller.php index 5760c160c..bb87d6beb 100644 --- a/src/Composer/Installer/PluginInstaller.php +++ b/src/Composer/Installer/PluginInstaller.php @@ -38,7 +38,7 @@ class PluginInstaller extends LibraryInstaller /** * @inheritDoc */ - public function supports($packageType) + public function supports(string $packageType) { return $packageType === 'composer-plugin' || $packageType === 'composer-installer'; } diff --git a/src/Composer/Package/Archiver/PharArchiver.php b/src/Composer/Package/Archiver/PharArchiver.php index d7ecf9dbe..225a4a91a 100644 --- a/src/Composer/Package/Archiver/PharArchiver.php +++ b/src/Composer/Package/Archiver/PharArchiver.php @@ -36,7 +36,7 @@ class PharArchiver implements ArchiverInterface /** * @inheritDoc */ - public function archive($sources, $target, $format, array $excludes = array(), $ignoreFilters = false): string + public function archive(string $sources, string $target, string $format, array $excludes = array(), bool $ignoreFilters = false): string { $sources = realpath($sources); @@ -97,7 +97,7 @@ class PharArchiver implements ArchiverInterface /** * @inheritDoc */ - public function supports($format, $sourceType): bool + public function supports(string $format, string $sourceType): bool { return isset(static::$formats[$format]); } diff --git a/src/Composer/Package/Archiver/ZipArchiver.php b/src/Composer/Package/Archiver/ZipArchiver.php index 59687a2b2..8c655f6a0 100644 --- a/src/Composer/Package/Archiver/ZipArchiver.php +++ b/src/Composer/Package/Archiver/ZipArchiver.php @@ -28,7 +28,7 @@ class ZipArchiver implements ArchiverInterface /** * @inheritDoc */ - public function archive($sources, $target, $format, array $excludes = array(), $ignoreFilters = false): string + public function archive(string $sources, string $target, string $format, array $excludes = array(), bool $ignoreFilters = false): string { $fs = new Filesystem(); $sources = $fs->normalizePath($sources); @@ -78,7 +78,7 @@ class ZipArchiver implements ArchiverInterface /** * @inheritDoc */ - public function supports($format, $sourceType): bool + public function supports(string $format, string $sourceType): bool { return isset(static::$formats[$format]) && $this->compressionAvailable(); }