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

Breadcrumb

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

function InputArgument::complete

Same name in this branch
  1. 11.1.x vendor/symfony/console/Input/InputArgument.php \Symfony\Component\Console\Input\InputArgument::complete()

Adds suggestions to $suggestions for the current completion input.

Overrides InputArgument::complete

See also

Command::complete()

File

vendor/composer/composer/src/Composer/Console/Input/InputArgument.php, line 59

Class

InputArgument
Backport suggested values definition from symfony/console 6.1+

Namespace

Composer\Console\Input

Code

public function complete(CompletionInput $input, CompletionSuggestions $suggestions) : void {
    $values = $this->suggestedValues;
    if ($values instanceof \Closure && !\is_array($values = $values($input, $suggestions))) {
        // @phpstan-ignore function.impossibleType
        throw new LogicException(sprintf('Closure for option "%s" must return an array. Got "%s".', $this->getName(), get_debug_type($values)));
    }
    if ([] !== $values) {
        $suggestions->suggestValues($values);
    }
}

API Navigation

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