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);
        }
    }
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);
        }
    }
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 ) ; } }
Adds a sub-command.

@param SubCommandConfig $config The sub-command configuration.

@throws CannotAddCommandException If the command cannot be added.
Adds a sub - command .