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

addSubCommand() private method

Adds a sub-command.
private addSubCommand ( SubCommandConfig $config )
$config Webmozart\Console\Api\Config\SubCommandConfig The sub-command configuration.
    private function addSubCommand(SubCommandConfig $config)
    {
        if (!$config->isEnabled()) {
            return;
        }
        $this->validateSubCommandName($config);
        $command = new self($config, $this->application, $this);
        $this->subCommands->add($command);
        if ($config->isDefault()) {
            $this->defaultSubCommands->add($command);
        }
        if (!$config->isAnonymous()) {
            $this->namedSubCommands->add($command);
        }
    }