Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ArrayInput.php

function ArrayInput::parse

Overrides Input::parse

File

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

Class

ArrayInput
ArrayInput represents an input provided as an array.

Namespace

Symfony\Component\Console\Input

Code

protected function parse() : void {
    foreach ($this->parameters as $key => $value) {
        if ('--' === $key) {
            return;
        }
        if (str_starts_with($key, '--')) {
            $this->addLongOption(substr($key, 2), $value);
        }
        elseif (str_starts_with($key, '-')) {
            $this->addShortOption(substr($key, 1), $value);
        }
        else {
            $this->addArgument($key, $value);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal