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

editOptionCommand() public method

This method can be used to nicely edit an option command inherited from a parent configuration using the fluent API: php protected function configure() { parent::configure(); $this ->editCommand('server') ->editOptionCommand('add') ... ->end() ->end() ... ; }
See also: beginOptionCommand()
public editOptionCommand ( string $name ) : OptionCommandConfig
$name string The name of the option command to edit.
return OptionCommandConfig The option command configuration.
    public function editOptionCommand($name)
    {
        return $this->getSubCommandConfig($name);
    }

Usage Example

示例#1
0
 public function testEditOptionCommand()
 {
     $this->config->addSubCommandConfig($config1 = new OptionCommandConfig('command1', 'a'));
     $this->assertSame($config1, $this->config->editOptionCommand('command1'));
 }