Webmozart\Console\Api\Command\Command::getNamedSubCommands PHP Method

getNamedSubCommands() public method

Returns all sub-commands that are not anonymous.
public getNamedSubCommands ( ) : CommandCollection
return CommandCollection The named commands.
    public function getNamedSubCommands()
    {
        return $this->namedSubCommands;
    }

Usage Example

コード例 #1
0
ファイル: CommandHelp.php プロジェクト: webmozart/console
 /**
  * {@inheritdoc}
  */
 protected function renderHelp(BlockLayout $layout)
 {
     $help = $this->command->getConfig()->getHelp();
     $argsFormat = $this->command->getArgsFormat();
     $subCommands = $this->command->getNamedSubCommands();
     $this->renderUsage($layout, $this->command);
     if ($argsFormat->hasArguments()) {
         $this->renderArguments($layout, $argsFormat->getArguments());
     }
     if (!$subCommands->isEmpty()) {
         $this->renderSubCommands($layout, $subCommands);
     }
     if ($argsFormat->hasOptions(false)) {
         $this->renderOptions($layout, $argsFormat->getOptions(false));
     }
     if ($argsFormat->getBaseFormat() && $argsFormat->getBaseFormat()->hasOptions()) {
         $this->renderGlobalOptions($layout, $argsFormat->getBaseFormat()->getOptions());
     }
     if ($help) {
         $this->renderDescription($layout, $help);
     }
 }
All Usage Examples Of Webmozart\Console\Api\Command\Command::getNamedSubCommands