Webmozart\Console\Api\Config\ApplicationConfig::addCommandConfigs PHP Method

addCommandConfigs() public method

Adds command configurations to the application.
See also: beginCommand()
public addCommandConfigs ( array $configs ) : static
$configs array The command configurations.
return static The current instance.
    public function addCommandConfigs(array $configs)
    {
        foreach ($configs as $command) {
            $this->addCommandConfig($command);
        }
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 public function testAddCommandConfigs()
 {
     $this->config->addCommandConfig($config1 = new CommandConfig('command1'));
     $this->config->addCommandConfigs(array($config2 = new CommandConfig('command2'), $config3 = new CommandConfig('command3')));
     $this->assertSame(array($config1, $config2, $config3), $this->config->getCommandConfigs());
 }