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

hasNamedSubCommands() public method

Returns whether the command has any commands that are not anonymous.
See also: getNamedSubCommands()
public hasNamedSubCommands ( ) : boolean
return boolean Returns `true` if the command has named commands and `false` otherwise.
    public function hasNamedSubCommands()
    {
        return count($this->namedSubCommands) > 0;
    }

Usage Example

コード例 #1
0
ファイル: CommandTest.php プロジェクト: webmozart/console
 public function testHasNoNamedSubCommands()
 {
     $config = new CommandConfig('command');
     $subConfig = new SubCommandConfig('sub');
     $subConfig->markAnonymous();
     $config->addSubCommandConfig($subConfig);
     $command = new Command($config);
     $this->assertFalse($command->hasNamedSubCommands());
 }