You are here

public function Input::setArgument in Zircon Profile 8.0

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

Sets an argument value by name.

Parameters

string $name The argument name:

string $value The argument value:

Throws

\InvalidArgumentException When argument given doesn't exist

Overrides InputInterface::setArgument

File

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

Class

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

Namespace

Symfony\Component\Console\Input

Code

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