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

Breadcrumb

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

function InputDefinition::shortcutToName

Returns the InputOption name given a shortcut.

@internal

Throws

InvalidArgumentException When option given does not exist

1 call to InputDefinition::shortcutToName()
InputDefinition::getOptionForShortcut in vendor/symfony/console/Input/InputDefinition.php
Gets an InputOption by shortcut.

File

vendor/symfony/console/Input/InputDefinition.php, line 329

Class

InputDefinition
A InputDefinition represents a set of valid command line arguments and options.

Namespace

Symfony\Component\Console\Input

Code

public function shortcutToName(string $shortcut) : string {
    if (!isset($this->shortcuts[$shortcut])) {
        throw new InvalidArgumentException(\sprintf('The "-%s" option does not exist.', $shortcut));
    }
    return $this->shortcuts[$shortcut];
}

API Navigation

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