src/console/Command.php
public function setAliases(array $names) {
        if ($this->frozen)      throw new RuntimeException('Configuration of "'.get_class($this).'" is frozen');
        if ($this->name === '') throw new IllegalStateException('A default command (name="") cannot have aliases');

        foreach ($names as $i => $alias) {
            $this->validateName($alias);
        }
        $this->aliases = array_diff($names, [$this->name]);     // remove an overlapping command name
        return $this;
    }
public function setAliases(array $names) {
        if ($this->frozen)      throw new RuntimeException('Configuration of "'.get_class($this).'" is frozen');
        if ($this->name === '') throw new IllegalStateException('A default command (name="") cannot have aliases');

        foreach ($names as $i => $alias) {
            $this->validateName($alias);
        }
        $this->aliases = array_diff($names, [$this->name]);     // remove an overlapping command name
        return $this;
    }
public function setAliases ( array $ names ) { if ( $ this -> frozen ) throw new RuntimeException ( 'Configuration of "' . get_class ( $ this ) . '" is frozen' ) ; if ( $ this -> name === '' ) throw new IllegalStateException ( 'A default command (name="") cannot have aliases' ) ; foreach ( $ names as $ i => $ alias ) { $ this -> validateName ( $ alias ) ; } $ this -> aliases = array_diff ( $ names , [ $ this -> name ] ) ; // remove an overlapping command name return $ this ; }
Set the alias names of the command if the command has a non-empty name. A command with an empty name is considered
the default command and cannot have aliases.

@param  string[] $names

@return $this
Set the alias names of the command if the command has a non - empty name . A command with an empty name is considered the default command and cannot have aliases .