| Methods |
public
|
__construct(string $question, array $choices, mixed $default = null)
Parameters
| $question |
The question to ask to the user
|
| $choices |
The list of available choices
|
| $default |
The default answer to return
|
Overrides
|
#
|
public
|
getChoices(): array
Returns available choices.
Returns available choices.
|
#
|
public
|
setMultiselect(bool $multiselect): $this
Sets multiselect option.
Sets multiselect option.
When multiselect is set to true, multiple choices can be answered.
|
#
|
public
|
isMultiselect(): bool
Returns whether the choices are multiselect.
Returns whether the choices are multiselect.
|
#
|
public
|
getPrompt(): string
Gets the prompt for choices.
Gets the prompt for choices.
|
#
|
public
|
setPrompt(string $prompt): $this
Sets the prompt for choices.
Sets the prompt for choices.
|
#
|
public
|
setErrorMessage(string $errorMessage): $this
Sets the error message for invalid values.
Sets the error message for invalid values.
The error message has a string placeholder (%s) for the invalid value.
|
#
|
private
|
getDefaultValidator(): callable
|
#
|