You are here

public function Input::getArgument 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::getArgument()

Returns the argument value for a given argument name.

Parameters

string $name The argument name:

Return value

mixed The argument value

Throws

\InvalidArgumentException When argument given doesn't exist

Overrides InputInterface::getArgument

File

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

Class

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

Namespace

Symfony\Component\Console\Input

Code

public function getArgument($name) {
  if (!$this->definition
    ->hasArgument($name)) {
    throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
  }
  return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition
    ->getArgument($name)
    ->getDefault();
}