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

Breadcrumb

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

function ArrayInput::addShortOption

Adds a short option value.

Throws

InvalidOptionException When option given doesn't exist

1 call to ArrayInput::addShortOption()
ArrayInput::parse in vendor/symfony/console/Input/ArrayInput.php
Processes command line arguments.

File

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

Class

ArrayInput
ArrayInput represents an input provided as an array.

Namespace

Symfony\Component\Console\Input

Code

private function addShortOption(string $shortcut, mixed $value) : void {
    if (!$this->definition
        ->hasShortcut($shortcut)) {
        throw new InvalidOptionException(\sprintf('The "-%s" option does not exist.', $shortcut));
    }
    $this->addLongOption($this->definition
        ->getOptionForShortcut($shortcut)
        ->getName(), $value);
}

API Navigation

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