Returns whether a sub-command with the given name exists.
public hasSubCommand ( string $name ) : boolean | ||
$name | string | The name of the sub-command. |
return | boolean | Returns `true` if a sub-command with that name exists and `false` otherwise. |
public function testHasSubCommand() { $config = new CommandConfig('command'); $config->addSubCommandConfig(new SubCommandConfig('sub')); $command = new Command($config); $this->assertTrue($command->hasSubCommand('sub')); $this->assertFalse($command->hasSubCommand('foobar')); }