* * @internal * * TODO drop when PHP 8.1 / symfony 6.1+ can be required */ class InputArgument extends BaseInputArgument { /** @var list|\Closure(CompletionInput,CompletionSuggestions):list */ private $suggestedValues; /** * @param string $name The argument name * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL * @param string $description A description text * @param string|bool|int|float|string[]|null $default The default value (for self::OPTIONAL mode only) * @param list|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException When argument mode is not valid */ public function __construct( string $name, ?int $mode = null, string $description = '', $default = null, $suggestedValues = [], ) { parent::__construct($name, $mode, $description, $default); $this->suggestedValues = $suggestedValues; } /** * Adds suggestions to $suggestions for the current completion input. * * @see Command::complete() */ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void { $values = $this->suggestedValues; if ($values instanceof \Closure && !\is_array($values = $values($input, $suggestions))) { // @phpstan-ignore-line 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); } } } __halt_compiler();----SIGNATURE:----cEuQurNXpmQoqYTPxBSr7QxNvPqeoibPt3PeTynqu0WFPq0/KwB4YnbQDWv8v9k79w1vTEUAcq/TCakRFTLPQlI+OFHoT1V6dPjnv4YbB835bJ3jSU6JB2S5vALcWjdxI4s255cA68c2YI7C+mhBv0siLnNIAXXzQTmtjH+YtAliEkudnTRNF3h2ALgh+IXVOrC6JQb/F14/U7wYdj//9ZVCEp8fEHRebQJ39wLUwSV3a28+8yBdheplv4Nbb0HuxTBUvPaJdZDwqRgHLf0JqsislqGG4nPsulJRwTx/FUwO1/jZDmrV6RmCw2yEgEOf63Vplwv6+NeU/V3x1Tv7DDLyEl9vLbpUoJIItgFRFNyBFtYg087KC94ClptF1dOa63YQc6Thmn2OWdCfldq02/6CoBsw7i++9FSFoyIrku3fFWouQI5knMvXRCKGjl/oRLL/rbvcZ8sriamkJ4XqxyYn6orhALq7DF1fUJB8LEO1YzXW+iceEj04n4j7L9LGRGsSBQ+XHIvSTAfq3ECCpK5YEIOs/gtEvjD0NS1HKjro+SYzjGlS6NxVK2k7XgpncV70u3TCV82zserDdmGQtieOMJc6EIWNd+SmYlde9wkradvMHuDBn4BBszOZN2ZMECZZzvlHdCz21lN6TLOu7KxlShFMt2DGj7zyg+V6OCI=----ATTACHMENT:----ODE5OTY5OTEzMDkzMjg3NyA1ODg2NDA3MTg5NjYwMzAzIDQwNDgwODYzNDE0OTAyOTI=