Fix type errors in interactive package selection, fixes #10712
parent
58e135181d
commit
0efb557afc
|
@ -186,7 +186,7 @@ trait PackageDiscoveryTrait
|
||||||
$io->writeError($choices);
|
$io->writeError($choices);
|
||||||
$io->writeError('');
|
$io->writeError('');
|
||||||
|
|
||||||
$validator = function ($selection) use ($matches, $versionParser) {
|
$validator = function (string $selection) use ($matches, $versionParser) {
|
||||||
if ('' === $selection) {
|
if ('' === $selection) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -218,13 +218,13 @@ trait PackageDiscoveryTrait
|
||||||
'Enter package # to add, or the complete package name if it is not listed: ',
|
'Enter package # to add, or the complete package name if it is not listed: ',
|
||||||
$validator,
|
$validator,
|
||||||
3,
|
3,
|
||||||
false
|
''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// no constraint yet, determine the best version automatically
|
// no constraint yet, determine the best version automatically
|
||||||
if (false !== $package && false === strpos($package, ' ')) {
|
if (false !== $package && false === strpos($package, ' ')) {
|
||||||
$validator = function ($input) {
|
$validator = function (string $input) {
|
||||||
$input = trim($input);
|
$input = trim($input);
|
||||||
|
|
||||||
return strlen($input) > 0 ? $input : false;
|
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): ',
|
'Enter the version constraint to require (or leave blank to use the latest version): ',
|
||||||
$validator,
|
$validator,
|
||||||
3,
|
3,
|
||||||
false
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
if (false === $constraint) {
|
if (false === $constraint) {
|
||||||
|
|
Loading…
Reference in New Issue