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