Webmozart\Console\Api\Application\Application::getNamedCommands PHP Method

getNamedCommands() public method

Returns the commands that are not anonymous.
public getNamedCommands ( ) : CommandCollection
return Webmozart\Console\Api\Command\CommandCollection The named commands.
    public function getNamedCommands();

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function renderHelp(BlockLayout $layout)
 {
     $help = $this->application->getConfig()->getHelp();
     $commands = $this->application->getNamedCommands();
     $globalArgsFormat = $this->application->getGlobalArgsFormat();
     $argsFormat = ArgsFormat::build()->addArgument(new Argument('command', Argument::REQUIRED, 'The command to execute'))->addArgument(new Argument('arg', Argument::MULTI_VALUED, 'The arguments of the command'))->addOptions($globalArgsFormat->getOptions())->getFormat();
     $this->renderName($layout, $this->application);
     $this->renderUsage($layout, $this->application, $argsFormat);
     $this->renderArguments($layout, $argsFormat->getArguments());
     if ($argsFormat->hasOptions()) {
         $this->renderGlobalOptions($layout, $argsFormat->getOptions());
     }
     if (!$commands->isEmpty()) {
         $this->renderCommands($layout, $commands);
     }
     if ($help) {
         $this->renderDescription($layout, $help);
     }
 }
All Usage Examples Of Webmozart\Console\Api\Application\Application::getNamedCommands