From df556597485a4b0f81666f6fdef7a2491eab0ebb Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 7 Apr 2022 13:57:33 +0200 Subject: [PATCH] Fix type errors in interactive package selection, fixes #10712 --- src/Composer/Command/PackageDiscoveryTrait.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Command/PackageDiscoveryTrait.php b/src/Composer/Command/PackageDiscoveryTrait.php index 39f4b9efd910..ad996b9942ea 100644 --- a/src/Composer/Command/PackageDiscoveryTrait.php +++ b/src/Composer/Command/PackageDiscoveryTrait.php @@ -184,7 +184,7 @@ final protected function determineRequirements(InputInterface $input, OutputInte $io->writeError($choices); $io->writeError(''); - $validator = function ($selection) use ($matches, $versionParser) { + $validator = function (string $selection) use ($matches, $versionParser) { if ('' === $selection) { return false; } @@ -216,13 +216,13 @@ final protected function determineRequirements(InputInterface $input, OutputInte 'Enter package # to add, or the complete package name if it is not listed: ', $validator, 3, - false + '' ); } // no constraint yet, determine the best version automatically if (false !== $package && false === strpos($package, ' ')) { - $validator = function ($input) { + $validator = function (string $input) { $input = trim($input); return strlen($input) > 0 ? $input : false; @@ -232,7 +232,7 @@ final protected function determineRequirements(InputInterface $input, OutputInte 'Enter the version constraint to require (or leave blank to use the latest version): ', $validator, 3, - false + '' ); if (false === $constraint) {