You are here

public function Input::setOption in Zircon Profile 8

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

Sets an option value by name.

Parameters

string $name The option name:

string|bool $value The option value:

Throws

\InvalidArgumentException When option given doesn't exist

Overrides InputInterface::setOption

File

vendor/symfony/console/Input/Input.php, line 201

Class

Input
Input is the base class for all concrete Input classes.

Namespace

Symfony\Component\Console\Input

Code

public function setOption($name, $value) {
  if (!$this->definition
    ->hasOption($name)) {
    throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
  }
  $this->options[$name] = $value;
}