1
0
Fork 0

Fix phpstan error

pull/10996/head
Jordi Boggiano 2022-08-16 11:35:17 +02:00
parent 2fd4275e62
commit 07c3a63fa3
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 9 additions and 12 deletions

View File

@ -244,21 +244,18 @@ abstract class BaseCommand extends Command
} }
$envOptions = [ $envOptions = [
'COMPOSER_NO_DEV' => 'no-dev', 'COMPOSER_NO_DEV' => ['no-dev', 'update-no-dev'],
'COMPOSER_PREFER_STABLE' => 'prefer-stable', 'COMPOSER_PREFER_STABLE' => ['prefer-stable'],
'COMPOSER_PREFER_LOWEST' => 'prefer-lowest', 'COMPOSER_PREFER_LOWEST' => ['prefer-lowest'],
]; ];
foreach ($envOptions as $envName => $optionName) { foreach ($envOptions as $envName => $optionNames) {
foreach ($optionNames as $optionName) {
if (true === $input->hasOption($optionName)) { if (true === $input->hasOption($optionName)) {
if (false === $input->getOption($optionName) && (bool) Platform::getEnv($envName)) { if (false === $input->getOption($optionName) && (bool) Platform::getEnv($envName)) {
$input->setOption($optionName, true); $input->setOption($optionName, true);
} }
} }
} }
if (true == $input->hasOption('update-no-dev')) {
if (true !== $input->getOption('update-no-dev') && true == Platform::getEnv('COMPOSER_NO_DEV')) {
$input->setOption('update-no-dev', true);
}
} }
if (true === $input->hasOption('ignore-platform-reqs')) { if (true === $input->hasOption('ignore-platform-reqs')) {