You are here

public function Command::addArgument in Zircon Profile 8

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

Adds an argument.

Parameters

string $name The argument name:

int $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL:

string $description A description text:

mixed $default The default value (for InputArgument::OPTIONAL mode only):

Return value

Command The current instance

File

vendor/symfony/console/Command/Command.php, line 369

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

public function addArgument($name, $mode = null, $description = '', $default = null) {
  $this->definition
    ->addArgument(new InputArgument($name, $mode, $description, $default));
  return $this;
}