You are here

public function Command::setDefinition 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::setDefinition()

Sets an array of argument and option instances.

Parameters

array|InputDefinition $definition An array of argument and option instances or a definition instance:

Return value

Command The current instance

File

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

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

public function setDefinition($definition) {
  if ($definition instanceof InputDefinition) {
    $this->definition = $definition;
  }
  else {
    $this->definition
      ->setDefinition($definition);
  }
  $this->applicationDefinitionMerged = false;
  return $this;
}