function ArrayInput::getParameterOption
Overrides InputInterface::getParameterOption
File
-
vendor/
symfony/ console/ Input/ ArrayInput.php, line 69
Class
- ArrayInput
- ArrayInput represents an input provided as an array.
Namespace
Symfony\Component\Console\InputCode
public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false) : mixed {
$values = (array) $values;
foreach ($this->parameters as $k => $v) {
if ($onlyParams && ('--' === $k || \is_int($k) && '--' === $v)) {
return $default;
}
if (\is_int($k)) {
if (\in_array($v, $values)) {
return true;
}
}
elseif (\in_array($k, $values)) {
return $v;
}
}
return $default;
}