1
0
Fork 0

Fix type errors in interactive package selection, fixes #10712

pull/10718/head
Jordi Boggiano 2022-04-07 13:57:33 +02:00
parent 58e135181d
commit 0efb557afc
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 4 deletions

View File

@ -186,7 +186,7 @@ trait PackageDiscoveryTrait
$io->writeError($choices);
$io->writeError('');
$validator = function ($selection) use ($matches, $versionParser) {
$validator = function (string $selection) use ($matches, $versionParser) {
if ('' === $selection) {
return false;
}
@ -218,13 +218,13 @@ trait PackageDiscoveryTrait
'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;
@ -234,7 +234,7 @@ trait PackageDiscoveryTrait
'Enter the version constraint to require (or leave blank to use the latest version): ',
$validator,
3,
false
''
);
if (false === $constraint) {