protected function _parseArg($argument, $args)
    {
        if (empty($this->_args)) {
            $args[] = $argument;

            return $args;
        }
        $next = count($args);
        if (!isset($this->_args[$next])) {
            throw new ConsoleException('Too many arguments.');
        }

        if ($this->_args[$next]->validChoice($argument)) {
            $args[] = $argument;

            return $args;
        }
    }
protected function _parseArg($argument, $args)
    {
        if (empty($this->_args)) {
            $args[] = $argument;

            return $args;
        }
        $next = count($args);
        if (!isset($this->_args[$next])) {
            throw new ConsoleException('Too many arguments.');
        }

        if ($this->_args[$next]->validChoice($argument)) {
            $args[] = $argument;

            return $args;
        }
    }
protected function _parseArg ( $ argument , $ args ) { if ( empty ( $ this -> _args ) ) { $ args [ ] = $ argument ; return $ args ; } $ next = count ( $ args ) ; if ( ! isset ( $ this -> _args [ $ next ] ) ) { throw new ConsoleException ( 'Too many arguments.' ) ; } if ( $ this -> _args [ $ next ] -> validChoice ( $ argument ) ) { $ args [ ] = $ argument ; return $ args ; } }
Parse an argument, and ensure that the argument doesn't exceed the number of arguments
and that the argument is a valid choice.

@param string $argument The argument to append
@param array $args The array of parsed args to append to.
@return string[] Args
@throws \Cake\Console\Exception\ConsoleException
Parse an argument and ensure that the argument doesn t exceed the number of arguments and that the argument is a valid choice .