Choice
class Choice extends Component
Properties
| protected array<int, callable(string): string> | $mutators | The list of mutators to apply on the view data. |
from Component |
Methods
array|string
mutate(array|string $data, array $mutators)
Mutate the given data with the given set of mutators.
from
Component
mixed
usingQuestionHelper(callable $callable)
Perform a question using the component's question helper.
from
Component
mixed
render(string $question, array $choices, mixed $default = null, int|null $attempts = null, bool $multiple = false)
Render the component using the given arguments.
ChoiceQuestion
getChoiceQuestion(string $question, array $choices, mixed $default)
Get a ChoiceQuestion instance that handles array keys like Prompts.
bool
isAssoc(array $array)
No description
Details
in
Component at line 28
__construct(OutputInterface $output)
Create a new component instance.
in
Component at line 36
protected void
renderView(string $view, array $data, int $verbosity)
Render the given view.
in
Component at line 46
protected string
compile(string $view, array $data)
Compile the given view contents.
in
Component at line 66
protected array|string
mutate(array|string $data, array $mutators)
Mutate the given data with the given set of mutators.
in
Component at line 86
protected mixed
usingQuestionHelper(callable $callable)
Perform a question using the component's question helper.
at line 17
mixed
render(string $question, array $choices, mixed $default = null, int|null $attempts = null, bool $multiple = false)
Render the component using the given arguments.
at line 34
protected ChoiceQuestion
getChoiceQuestion(string $question, array $choices, mixed $default)
Get a ChoiceQuestion instance that handles array keys like Prompts.
at line 37
protected bool
isAssoc(array $array)
No description