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

Breadcrumb

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

function CompletionInput::fromString

Converts a terminal string into tokens.

This is required for shell completions without COMP_WORDS support.

1 call to CompletionInput::fromString()
GlobalCommand::complete in vendor/composer/composer/src/Composer/Command/GlobalCommand.php
@inheritdoc

File

vendor/symfony/console/Completion/CompletionInput.php, line 45

Class

CompletionInput
An input specialized for shell completion.

Namespace

Symfony\Component\Console\Completion

Code

public static function fromString(string $inputStr, int $currentIndex) : self {
    preg_match_all('/(?<=^|\\s)([\'"]?)(.+?)(?<!\\\\)\\1(?=$|\\s)/', $inputStr, $tokens);
    return self::fromTokens($tokens[0], $currentIndex);
}

API Navigation

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