Represents a yes/no question.
- author Fabien Potencier
| Methods |
public __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i')
|
| public Symfony\Component\Console\Question\Question::getAutocompleterCallback() : ?callable Gets the callback function used for the autocompleter.
|
| public Symfony\Component\Console\Question\Question::getAutocompleterValues() : ?iterable Gets values for the autocompleter. |
| public Symfony\Component\Console\Question\Question::getDefault() : string|int|float|bool|?null Returns the default answer. |
| public Symfony\Component\Console\Question\Question::getMaxAttempts() : ?int Gets the maximum number of attempts. Null means an unlimited number of attempts. |
| public Symfony\Component\Console\Question\Question::getNormalizer() : ?callable Gets the normalizer for the response.
|
| public Symfony\Component\Console\Question\Question::getQuestion() : string Returns the question. |
| public Symfony\Component\Console\Question\Question::getTimeout() : ?int Returns the timeout in seconds. |
| public Symfony\Component\Console\Question\Question::getValidator() : ?callable Gets the validator for the question.
|
| public Symfony\Component\Console\Question\Question::isHidden() : bool Returns whether the user response must be hidden. |
| public Symfony\Component\Console\Question\Question::isHiddenFallback() : bool In case the response cannot be hidden, whether to fallback on non-hidden question or not. |
| public Symfony\Component\Console\Question\Question::isMultiline() : bool Returns whether the user response accepts newline characters. |
| public Symfony\Component\Console\Question\Question::isTrimmable() : bool |
| public Symfony\Component\Console\Question\Question::setAutocompleterCallback(?callable $callback) : static 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.
|
| public Symfony\Component\Console\Question\Question::setAutocompleterValues(?iterable $values) : static Sets values for the autocompleter.
|
| public Symfony\Component\Console\Question\Question::setHidden(bool $hidden) : static Sets whether the user response must be hidden or not.
|
| public Symfony\Component\Console\Question\Question::setHiddenFallback(bool $fallback) : static Sets whether to fallback on non-hidden question if the response cannot be hidden.
|
| public Symfony\Component\Console\Question\Question::setMaxAttempts(?int $attempts) : static Sets the maximum number of attempts. Null means an unlimited number of attempts.
|
| public Symfony\Component\Console\Question\Question::setMultiline(bool $multiline) : static Sets whether the user response should accept newline characters.
|
| public Symfony\Component\Console\Question\Question::setNormalizer(callable $normalizer) : static Sets a normalizer for the response.
|
| public Symfony\Component\Console\Question\Question::setTimeout(?int $seconds) : static Sets the maximum time the user has to answer the question. If the user does not answer within this time, an exception will be thrown.
|
public Symfony\Component\Console\Question\Question::setTrimmable(bool $trimmable) : static
|
| public Symfony\Component\Console\Question\Question::setValidator(?callable $validator) : static Sets a validator for the question.
|
| Methods |
| protected Symfony\Component\Console\Question\Question::isAssoc(array $array) : bool |
| Properties |
| private string $trueAnswerRegex |
| Methods |
| private getDefaultNormalizer() : callable Returns the default answer normalizer. |