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

__construct(OutputInterface $output)

Create a new component instance.

void
renderView(string $view, array $data, int $verbosity)

Render the given view.

string
compile(string $view, array $data)

Compile the given view contents.

array|string
mutate(array|string $data, array $mutators)

Mutate the given data with the given set of mutators.

mixed
usingQuestionHelper(callable $callable)

Perform a question using the component's question helper.

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.

Parameters

OutputInterface $output

in Component at line 36
protected void renderView(string $view, array $data, int $verbosity)

Render the given view.

Parameters

string $view
array $data
int $verbosity

Return Value

void

in Component at line 46
protected string compile(string $view, array $data)

Compile the given view contents.

Parameters

string $view
array $data

Return Value

string

in Component at line 66
protected array|string mutate(array|string $data, array $mutators)

Mutate the given data with the given set of mutators.

Parameters

array|string $data
array $mutators

Return Value

array|string

in Component at line 86
protected mixed usingQuestionHelper(callable $callable)

Perform a question using the component's question helper.

Parameters

callable $callable

Return Value

mixed

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.

Parameters

string $question
array $choices
mixed $default
int|null $attempts
bool $multiple

Return Value

mixed

at line 34
protected ChoiceQuestion getChoiceQuestion(string $question, array $choices, mixed $default)

Get a ChoiceQuestion instance that handles array keys like Prompts.

Parameters

string $question
array $choices
mixed $default

Return Value

ChoiceQuestion

at line 37
protected bool isAssoc(array $array)

No description

Parameters

array $array

Return Value

bool