Returns the command for a given name.
public getCommand ( string $name ) : |
||
$name | string | The name of the command. |
return | The command. |
protected function setUp() { $config = DefaultApplicationConfig::create()->setDisplayName('The Application')->setVersion('1.2.3')->beginCommand('the-command')->end(); $this->application = new ConsoleApplication($config); $this->command = $this->application->getCommand('the-command'); $this->helpCommand = $this->application->getCommand('help'); $this->io = new BufferedIO(); $this->handler = new HelpXmlHandler(); }
protected function setUp() { $config = DefaultApplicationConfig::create()->beginCommand('the-command')->end(); $this->application = new ConsoleApplication($config); $this->command = $this->application->getCommand('the-command'); $this->helpCommand = $this->application->getCommand('help'); $this->io = new BufferedIO(); $this->handler = new HelpJsonHandler(); }
protected function setUp() { $config = DefaultApplicationConfig::create()->setName('the-app')->setDisplayName('The Application')->setVersion('1.2.3')->beginCommand('the-command')->end(); $this->manDir = __DIR__ . '/Fixtures/man'; $this->asciiDocDir = __DIR__ . '/Fixtures/ascii-doc'; $this->application = new ConsoleApplication($config); $this->command = $this->application->getCommand('the-command'); $this->helpCommand = $this->application->getCommand('help'); $this->io = new BufferedIO(); $this->executableFinder = $this->getMockBuilder('Symfony\\Component\\Process\\ExecutableFinder')->disableOriginalConstructor()->getMock(); $this->processLauncher = $this->getMockBuilder('Webmozart\\Console\\Process\\ProcessLauncher')->disableOriginalConstructor()->getMock(); $this->handler = new HelpHandler($this->executableFinder, $this->processLauncher); $this->handler->setManDir($this->manDir); $this->handler->setAsciiDocDir($this->asciiDocDir); }
private function getPageName(Application $application, Args $args) { if ($args->isArgumentSet('command')) { $command = $application->getCommand($args->getArgument('command')); return $this->commandPagePrefix . $command->getName(); } if ($this->applicationPage) { return $this->applicationPage; } return $application->getConfig()->getName(); }