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

Breadcrumb

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

function InputArgument::__construct

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

Parameters

string $name The argument name:

int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL:

string $description A description text:

string|bool|int|float|string[]|null $default The default value (for self::OPTIONAL mode only):

list<string>|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion:

Throws

InvalidArgumentException When argument mode is not valid

Overrides InputArgument::__construct

File

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

Class

InputArgument
Backport suggested values definition from symfony/console 6.1+

Namespace

Composer\Console\Input

Code

public function __construct(string $name, ?int $mode = null, string $description = '', $default = null, $suggestedValues = []) {
    parent::__construct($name, $mode, $description, $default);
    $this->suggestedValues = $suggestedValues;
}

API Navigation

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