You are here

protected function ArrayInput::parse in Zircon Profile 8

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

Processes command line arguments.

Overrides Input::parse

File

vendor/symfony/console/Input/ArrayInput.php, line 133

Class

ArrayInput
ArrayInput represents an input provided as an array.

Namespace

Symfony\Component\Console\Input

Code

protected function parse() {
  foreach ($this->parameters as $key => $value) {
    if (0 === strpos($key, '--')) {
      $this
        ->addLongOption(substr($key, 2), $value);
    }
    elseif ('-' === $key[0]) {
      $this
        ->addShortOption(substr($key, 1), $value);
    }
    else {
      $this
        ->addArgument($key, $value);
    }
  }
}