You are here

protected function ArgvInput::parse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Input/ArgvInput.php \Symfony\Component\Console\Input\ArgvInput::parse()

Processes command line arguments.

Overrides Input::parse

File

vendor/symfony/console/Input/ArgvInput.php, line 72

Class

ArgvInput
ArgvInput represents an input coming from the CLI arguments.

Namespace

Symfony\Component\Console\Input

Code

protected function parse() {
  $parseOptions = true;
  $this->parsed = $this->tokens;
  while (null !== ($token = array_shift($this->parsed))) {
    if ($parseOptions && '' == $token) {
      $this
        ->parseArgument($token);
    }
    elseif ($parseOptions && '--' == $token) {
      $parseOptions = false;
    }
    elseif ($parseOptions && 0 === strpos($token, '--')) {
      $this
        ->parseLongOption($token);
    }
    elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
      $this
        ->parseShortOption($token);
    }
    else {
      $this
        ->parseArgument($token);
    }
  }
}