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/composer/composer/src/Composer/Console/Input/InputArgument.php \Composer\Console\Input\InputArgument::complete()

Supplies suggestions when command resolves possible completion options for input.

See also

Command::complete()

1 method overrides InputArgument::complete()
InputArgument::complete in vendor/composer/composer/src/Composer/Console/Input/InputArgument.php
Adds suggestions to $suggestions for the current completion input.

File

vendor/symfony/console/Input/InputArgument.php, line 142

Class

InputArgument
Represents a command line argument.

Namespace

Symfony\Component\Console\Input

Code

public function complete(CompletionInput $input, CompletionSuggestions $suggestions) : void {
    $values = $this->suggestedValues;
    if ($values instanceof \Closure && !\is_array($values = $values($input))) {
        throw new LogicException(\sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, 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