Fix phpstan error
parent
2fd4275e62
commit
07c3a63fa3
|
@ -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')) {
|
||||||
|
|
Loading…
Reference in New Issue