You are here

public function ArrayInput::getParameterOption in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Input/ArrayInput.php \Symfony\Component\Console\Input\ArrayInput::getParameterOption()

Returns the value of a raw option (not parsed).

This method is to be used to introspect the input parameters before they have been validated. It must be used carefully.

Parameters

string|array $values The value(s) to look for in the raw parameters (can be an array):

mixed $default The default value to return if no result is found:

Return value

mixed The option value

Overrides InputInterface::getParameterOption

File

vendor/symfony/console/Input/ArrayInput.php, line 94

Class

ArrayInput
ArrayInput represents an input provided as an array.

Namespace

Symfony\Component\Console\Input

Code

public function getParameterOption($values, $default = false) {
  $values = (array) $values;
  foreach ($this->parameters as $k => $v) {
    if (is_int($k)) {
      if (in_array($v, $values)) {
        return true;
      }
    }
    elseif (in_array($k, $values)) {
      return $v;
    }
  }
  return $default;
}