1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Add return types to closures (#9)

This commit is contained in:
Alexander Schranz 2022-02-21 13:37:49 +01:00 committed by GitHub
parent 7b1fc4b2c8
commit 1321bfca36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 171 additions and 150 deletions

View file

@ -129,7 +129,7 @@ EOT
// extract --with shorthands from the allowlist
if (count($packages) > 0) {
$allowlistPackagesWithRequirements = array_filter($packages, function ($pkg) {
$allowlistPackagesWithRequirements = array_filter($packages, function ($pkg): bool {
return Preg::isMatch('{\S+[ =:]\S+}', $pkg);
});
foreach ($this->formatRequirements($allowlistPackagesWithRequirements) as $package => $constraint) {
@ -180,7 +180,7 @@ EOT
// the arguments lock/nothing/mirrors are not package names but trigger a mirror update instead
// they are further mutually exclusive with listing actual package names
$filteredPackages = array_filter($packages, function ($package) {
$filteredPackages = array_filter($packages, function ($package): bool {
return !in_array($package, array('lock', 'nothing', 'mirrors'), true);
});
$updateMirrors = $input->getOption('lock') || count($filteredPackages) != count($packages);