public function getCommand($name, array $args = [])
    {
        if (!$this->description->hasOperation($name)) {
            $name = ucfirst($name);
            if (!$this->description->hasOperation($name)) {
                throw new \InvalidArgumentException(
                    "No operation found named {$name}"
                );
            }
        }

        // Merge in default command options
        $args += $this->getConfig('defaults');

        return parent::getCommand($name, $args);
    }
public function getCommand($name, array $args = [])
    {
        if (!$this->description->hasOperation($name)) {
            $name = ucfirst($name);
            if (!$this->description->hasOperation($name)) {
                throw new \InvalidArgumentException(
                    "No operation found named {$name}"
                );
            }
        }

        // Merge in default command options
        $args += $this->getConfig('defaults');

        return parent::getCommand($name, $args);
    }
public function getCommand ( $ name , array $ args = [ ] ) { if ( ! $ this -> description -> hasOperation ( $ name ) ) { $ name = ucfirst ( $ name ) ; if ( ! $ this -> description -> hasOperation ( $ name ) ) { throw new \ InvalidArgumentException ( "No operation found named {$name}" ) ; } } // Merge in default command options $ args += $ this -> getConfig ( 'defaults' ) ; return parent :: getCommand ( $ name , $ args ) ; }
Returns the command if valid; otherwise an Exception
@param string $name
@param array  $args
@return CommandInterface
@throws \InvalidArgumentException
Returns the command if valid ; otherwise an Exception