function Question::setAutocompleterCallback
Sets the callback function used for the autocompleter.
The callback is passed the user input as argument and should return an iterable of corresponding suggestions.
Return value
$this
1 call to Question::setAutocompleterCallback()
- Question::setAutocompleterValues in vendor/
symfony/ console/ Question/ Question.php - Sets values for the autocompleter.
File
-
vendor/
symfony/ console/ Question/ Question.php, line 176
Class
- Question
- Represents a Question.
Namespace
Symfony\Component\Console\QuestionCode
public function setAutocompleterCallback(?callable $callback) : static {
if ($this->hidden && null !== $callback) {
throw new LogicException('A hidden question cannot use the autocompleter.');
}
$this->autocompleterCallback = null === $callback ? null : $callback(...);
return $this;
}