diff --git a/src/CliProgram/CommandCall/CommandArgumentList.php b/src/CliProgram/CommandCall/CommandArgumentList.php index 186a15a..50c7ce3 100644 --- a/src/CliProgram/CommandCall/CommandArgumentList.php +++ b/src/CliProgram/CommandCall/CommandArgumentList.php @@ -94,19 +94,16 @@ class CommandArgumentList { public function copySymfonyOptionsOf (InputInterface $input): static { $this->copyVerbosityOptionOf($input); foreach ($input->getOptions() as $optionName => $optionValue) { - if (in_array($optionName, self::SYMFONY_OPTIONS_BOOL) && $optionValue === false) { - // Symfony se contente de regarder si le nom de l'option est donné, peu importe sa valeur, donc ils ne sont pas recopiés si à faux - continue; - } - elseif (in_array($optionName, self::SYMFONY_OPTIONS_TEXT) && $optionValue === null) { - // Symfony se contente de regarder si le nom de l'option est donné, peu importe sa valeur, donc n'est pas recopié si aucune valeur - continue; - } - elseif ($optionName == self::SYMFONY_OPTION_VERBOSITY) { + if ($optionName == self::SYMFONY_OPTION_VERBOSITY) { // Déjà géré via $this->copyVerbosityOptionOf continue; } - $this->addOption($optionName, $optionValue); + + if ((in_array($optionName, self::SYMFONY_OPTIONS_BOOL) && $optionValue !== false) + || (in_array($optionName, self::SYMFONY_OPTIONS_TEXT) && $optionValue !== null) + ) { + $this->addOption($optionName, $optionValue); + } } return $this; }