You are here

public function ApplicationDescription::getCommand in Zircon Profile 8

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

Parameters

string $name:

Return value

Command

Throws

\InvalidArgumentException

File

vendor/symfony/console/Descriptor/ApplicationDescription.php, line 94

Class

ApplicationDescription
@author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>

Namespace

Symfony\Component\Console\Descriptor

Code

public function getCommand($name) {
  if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
    throw new \InvalidArgumentException(sprintf('Command %s does not exist.', $name));
  }
  return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name];
}