original_string: 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;
          }
      }
code: 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;
          }
      }
code_tokens: 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 ; } }
docstring: 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
docstring_tokens: Parse an argument and ensure that the argument doesn t exceed the number of arguments and that the argument is a valid choice .