Webmozart\Console\Api\Config\CommandConfig::addSubCommandConfig PHP Method

addSubCommandConfig() public method

Adds configuration for a sub-command.
See also: beginSubCommand()
public addSubCommandConfig ( SubCommandConfig $config ) : static
$config SubCommandConfig The sub-command configuration.
return static The current instance.
    public function addSubCommandConfig(SubCommandConfig $config)
    {
        // The name is dynamic, so don't store by name
        $this->subCommandConfigs[] = $config;
        $config->setParentConfig($this);
        return $this;
    }

Usage Example

示例#1
0
 public function testEditOptionCommand()
 {
     $this->config->addSubCommandConfig($config1 = new OptionCommandConfig('command1', 'a'));
     $this->assertSame($config1, $this->config->editOptionCommand('command1'));
 }
All Usage Examples Of Webmozart\Console\Api\Config\CommandConfig::addSubCommandConfig