Question
class Question
Represents a Question.
Methods
Constructor.
Returns the question.
Returns the default answer.
Returns whether the user response must be hidden.
In case the response can not be hidden, whether to fallback on non-hidden question or not.
Sets whether to fallback on non-hidden question if the response can not be hidden.
Gets values for the autocompleter.
Sets a validator for the question.
Gets the validator for the question.
Sets the maximum number of attempts.
Gets the maximum number of attempts.
Sets a normalizer for the response.
Gets the normalizer for the response.
Details
at line line 39
__construct(string $question, mixed $default = null)
Constructor.
at line line 50
string
getQuestion()
Returns the question.
at line line 60
mixed
getDefault()
Returns the default answer.
at line line 70
bool
isHidden()
Returns whether the user response must be hidden.
at line line 84
Question
setHidden(bool $hidden)
Sets whether the user response must be hidden or not.
at line line 100
bool
isHiddenFallback()
In case the response can not be hidden, whether to fallback on non-hidden question or not.
at line line 112
Question
setHiddenFallback(bool $fallback)
Sets whether to fallback on non-hidden question if the response can not be hidden.
at line line 124
null|array|Traversable
getAutocompleterValues()
Gets values for the autocompleter.
at line line 139
Question
setAutocompleterValues(null|array|Traversable $values)
Sets values for the autocompleter.
at line line 167
Question
setValidator(callable $validator = null)
Sets a validator for the question.
at line line 179
null|callable
getValidator()
Gets the validator for the question.
at line line 195
Question
setMaxAttempts(null|int $attempts)
Sets the maximum number of attempts.
Null means an unlimited number of attempts.
at line line 213
null|int
getMaxAttempts()
Gets the maximum number of attempts.
Null means an unlimited number of attempts.
at line line 227
Question
setNormalizer(callable $normalizer)
Sets a normalizer for the response.
The normalizer can be a callable (a string), a closure or a class implementing __invoke.
at line line 241
callable
getNormalizer()
Gets the normalizer for the response.
The normalizer can ba a callable (a string), a closure or a class implementing __invoke.