public function remove($name)
    {
        if (isset($this->aliasIndex[$name])) {
            $this->remove($this->aliasIndex[$name]);

            return;
        }

        if (isset($this->shortNameIndex[$name])) {
            $this->remove($this->shortNameIndex[$name]);

            return;
        }

        unset($this->commands[$name]);

        foreach ($this->shortNameIndex as $shortName => $targetName) {
            if ($name === $targetName) {
                unset($this->shortNameIndex[$shortName]);
            }
        }

        foreach ($this->aliasIndex as $alias => $targetName) {
            if ($name === $targetName) {
                unset($this->aliasIndex[$alias]);
            }
        }
    }
public function remove($name)
    {
        if (isset($this->aliasIndex[$name])) {
            $this->remove($this->aliasIndex[$name]);

            return;
        }

        if (isset($this->shortNameIndex[$name])) {
            $this->remove($this->shortNameIndex[$name]);

            return;
        }

        unset($this->commands[$name]);

        foreach ($this->shortNameIndex as $shortName => $targetName) {
            if ($name === $targetName) {
                unset($this->shortNameIndex[$shortName]);
            }
        }

        foreach ($this->aliasIndex as $alias => $targetName) {
            if ($name === $targetName) {
                unset($this->aliasIndex[$alias]);
            }
        }
    }
public function remove ( $ name ) { if ( isset ( $ this -> aliasIndex [ $ name ] ) ) { $ this -> remove ( $ this -> aliasIndex [ $ name ] ) ; return ; } if ( isset ( $ this -> shortNameIndex [ $ name ] ) ) { $ this -> remove ( $ this -> shortNameIndex [ $ name ] ) ; return ; } unset ( $ this -> commands [ $ name ] ) ; foreach ( $ this -> shortNameIndex as $ shortName => $ targetName ) { if ( $ name === $ targetName ) { unset ( $ this -> shortNameIndex [ $ shortName ] ) ; } } foreach ( $ this -> aliasIndex as $ alias => $ targetName ) { if ( $ name === $ targetName ) { unset ( $ this -> aliasIndex [ $ alias ] ) ; } } }
Removes the command with the given name from the collection.

If no such command can be found, the method does nothing.

@param string $name The name of the command.
Removes the command with the given name from the collection .