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