src/Console/CommandTrait.php
public function connectCommand(Command $cmd)
    {
        $name = $cmd->name();
        $this->commands[$name] = $cmd;

        // regsiter command aliases to the alias table.
        $aliases = $cmd->aliases();
        if (is_string($aliases)) {
            $aliases = preg_split('/\s+/', $aliases);
        }

        if (!is_array($aliases)) {
            throw new InvalidArgumentException('Aliases needs to be an array or a space-separated string.');
        }

        foreach ($aliases as $alias) {
            $this->aliases[$alias] = $cmd;
        }
    }
public function connectCommand(Command $cmd)
    {
        $name = $cmd->name();
        $this->commands[$name] = $cmd;

        // regsiter command aliases to the alias table.
        $aliases = $cmd->aliases();
        if (is_string($aliases)) {
            $aliases = preg_split('/\s+/', $aliases);
        }

        if (!is_array($aliases)) {
            throw new InvalidArgumentException('Aliases needs to be an array or a space-separated string.');
        }

        foreach ($aliases as $alias) {
            $this->aliases[$alias] = $cmd;
        }
    }
public function connectCommand ( Command $ cmd ) { $ name = $ cmd -> name ( ) ; $ this -> commands [ $ name ] = $ cmd ; // regsiter command aliases to the alias table. $ aliases = $ cmd -> aliases ( ) ; if ( is_string ( $ aliases ) ) { $ aliases = preg_split ( '/\s+/' , $ aliases ) ; } if ( ! is_array ( $ aliases ) ) { throw new InvalidArgumentException ( 'Aliases needs to be an array or a space-separated string.' ) ; } foreach ( $ aliases as $ alias ) { $ this -> aliases [ $ alias ] = $ cmd ; } }
connectCommand connects a command name with a command object.

@param Command $cmd
connectCommand connects a command name with a command object .