library/Garp/Cli/Command.php
protected function _validateArguments($methodName, $args) {
        if (!array_key_exists($methodName, $this->_allowedArguments)
            || $this->_allowedArguments[$methodName] === '*'
        ) {
            return true;
        }

        $unknownArgs = array_diff(array_keys($args), $this->_allowedArguments[$methodName]);
        if (!count($unknownArgs)) {
            return true;
        }
        // Report the first erroneous argument
        $errorStr = current($unknownArgs);
        // Show the value of the argument if the index is numeric
        if (is_numeric($errorStr)) {
            $errorStr = $args[$unknownArgs[0]];
        }
        Garp_Cli::errorOut('Unexpected argument ' . $errorStr);
        return false;
    }
protected function _validateArguments($methodName, $args) {
        if (!array_key_exists($methodName, $this->_allowedArguments)
            || $this->_allowedArguments[$methodName] === '*'
        ) {
            return true;
        }

        $unknownArgs = array_diff(array_keys($args), $this->_allowedArguments[$methodName]);
        if (!count($unknownArgs)) {
            return true;
        }
        // Report the first erroneous argument
        $errorStr = current($unknownArgs);
        // Show the value of the argument if the index is numeric
        if (is_numeric($errorStr)) {
            $errorStr = $args[$unknownArgs[0]];
        }
        Garp_Cli::errorOut('Unexpected argument ' . $errorStr);
        return false;
    }
protected function _validateArguments ( $ methodName , $ args ) { if ( ! array_key_exists ( $ methodName , $ this -> _allowedArguments ) || $ this -> _allowedArguments [ $ methodName ] === '*' ) { return true ; } $ unknownArgs = array_diff ( array_keys ( $ args ) , $ this -> _allowedArguments [ $ methodName ] ) ; if ( ! count ( $ unknownArgs ) ) { return true ; } // Report the first erroneous argument $ errorStr = current ( $ unknownArgs ) ; // Show the value of the argument if the index is numeric if ( is_numeric ( $ errorStr ) ) { $ errorStr = $ args [ $ unknownArgs [ 0 ] ] ; } Garp_Cli :: errorOut ( 'Unexpected argument ' . $ errorStr ) ; return false ; }
Make sure the method is not inadvertently called with the
wrong arguments. This might indicate the user made a mistake
in calling it.

@param string $methodName
@param array $args
@return bool
Make sure the method is not inadvertently called with the wrong arguments . This might indicate the user made a mistake in calling it .