3 namespace Drush\Symfony;
5 use Symfony\Component\Console\Input\InputDefinition;
6 use Symfony\Component\Console\Input\InputOption;
7 use Symfony\Component\Console\Exception\InvalidArgumentException;
8 use Symfony\Component\Console\Exception\LogicException;
11 * This is an InputDefinition that allows any option to be considered valid.
12 * Used when passing a command through to another dispatcher that will do
13 * the option validation.
15 * We use this instead of a LessStrictArgvInput in cases where we do not
16 * know in advance whether the input should be handled indiscriminately.
17 * In other words, an IndiscriminateInputDefinition is attached to individual
18 * Commands that should accept any option, whereas a LessStrictArgvInput
19 * should be used to make all command skip option validation.
21 class IndiscriminateInputDefinition extends InputDefinition
26 public function hasShortcut($name)
34 public function hasOption($name)
42 public function getOption($name)
44 if (parent::hasOption($name)) {
45 return parent::getOption($name);
47 return new InputOption($name, null, InputOption::VALUE_OPTIONAL, '', []);