class DrushStyle extends SymfonyStyle (View source)

Methods

void
success(array|string $message)

No description

bool
confirm(string $question, bool $default = true, string $yes = 'Yes', string $no = 'No', bool|string $required = false, Closure|null $validate = null, string $hint = '')

No description

mixed
choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false, int $scroll = 15, Closure|null $validate = null, string $hint = '', bool|string $required = true)

No description

mixed
ask(Stringable|string $question, string|null $default = null, callable|null $validator = null, Stringable|string $placeholder = '', bool|string $required = false, Closure|null $validate = null, Stringable|string $hint = '')

Prompt the user for text input.

string
password(Stringable|string $label, Stringable|string $placeholder = '', bool|string $required = false, Closure|null $validate = null, Stringable|string $hint = '')

Prompt the user for input, hiding the value.

int|string
select(string $label, array $options, int|string|null $default = null, int $scroll = 10, Closure|null $validate = null, string $hint = '', bool|string $required = true)

Prompt the user to select an option.

array
multiselect(string $label, array $options, array $default = [], int $scroll = 10, bool|string $required = false, Closure|null $validate = null, string $hint = 'Use the space bar to select options.')

Prompt the user to select multiple options.

string
suggest(string $label, array|Closure $options, string $placeholder = '', string $default = '', int $scroll = 10, bool|string $required = false, Closure|null $validate = null, string $hint = 'Start typing the first letter(s) and matching choices will be shown.')

Prompt the user for text input with auto-completion.

int|string
search(string $label, Closure $options, string $placeholder = '', int $scroll = 10, Closure|null $validate = null, string $hint = '', bool|string $required = true)

Allow the user to search for an option.

array
multisearch(string $label, Closure $options, string $placeholder = '', int $scroll = 10, bool|string $required = false, Closure|null $validate = null, string $hint = 'Use the space bar to select options.')

Allow the user to search for multiple option.

mixed
spin(Closure $callback, string $message = '')

No description

Progress
progress(string $label, iterable|int $steps, Closure|null $callback = null, string $hint = '')

Display a progress bar.

void
warning(string|array $message)

No description

void
note(string|array $message)

No description

void
caution(string|array $message)

No description

mixed
askRequired($question)

No description

Details

void success(array|string $message)

No description

Parameters

array|string $message

Return Value

void

bool confirm(string $question, bool $default = true, string $yes = 'Yes', string $no = 'No', bool|string $required = false, Closure|null $validate = null, string $hint = '')

No description

Parameters

string $question
bool $default
string $yes
string $no
bool|string $required
Closure|null $validate
string $hint

Return Value

bool

mixed choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false, int $scroll = 15, Closure|null $validate = null, string $hint = '', bool|string $required = true)

No description

Parameters

string $question
array $choices
mixed $default
bool $multiSelect
int $scroll
Closure|null $validate
string $hint
bool|string $required

Return Value

mixed

mixed ask(Stringable|string $question, string|null $default = null, callable|null $validator = null, Stringable|string $placeholder = '', bool|string $required = false, Closure|null $validate = null, Stringable|string $hint = '')

Prompt the user for text input.

Parameters

Stringable|string $question
string|null $default
callable|null $validator
Stringable|string $placeholder
bool|string $required
Closure|null $validate
Stringable|string $hint

Return Value

mixed

string password(Stringable|string $label, Stringable|string $placeholder = '', bool|string $required = false, Closure|null $validate = null, Stringable|string $hint = '')

Prompt the user for input, hiding the value.

Parameters

Stringable|string $label
Stringable|string $placeholder
bool|string $required
Closure|null $validate
Stringable|string $hint

Return Value

string

int|string select(string $label, array $options, int|string|null $default = null, int $scroll = 10, Closure|null $validate = null, string $hint = '', bool|string $required = true)

Prompt the user to select an option.

Parameters

string $label
array $options
int|string|null $default
int $scroll
Closure|null $validate
string $hint
bool|string $required

Return Value

int|string

array multiselect(string $label, array $options, array $default = [], int $scroll = 10, bool|string $required = false, Closure|null $validate = null, string $hint = 'Use the space bar to select options.')

Prompt the user to select multiple options.

Parameters

string $label
array $options
array $default
int $scroll
bool|string $required
Closure|null $validate
string $hint

Return Value

array

string suggest(string $label, array|Closure $options, string $placeholder = '', string $default = '', int $scroll = 10, bool|string $required = false, Closure|null $validate = null, string $hint = 'Start typing the first letter(s) and matching choices will be shown.')

Prompt the user for text input with auto-completion.

Parameters

string $label
array|Closure $options
string $placeholder
string $default
int $scroll
bool|string $required
Closure|null $validate
string $hint

Return Value

string

Allow the user to search for an option.

Parameters

string $label
Closure $options
string $placeholder
int $scroll
Closure|null $validate
string $hint
bool|string $required

Return Value

int|string

array multisearch(string $label, Closure $options, string $placeholder = '', int $scroll = 10, bool|string $required = false, Closure|null $validate = null, string $hint = 'Use the space bar to select options.')

Allow the user to search for multiple option.

Parameters

string $label
Closure $options
string $placeholder
int $scroll
bool|string $required
Closure|null $validate
string $hint

Return Value

array

mixed spin(Closure $callback, string $message = '')

No description

Parameters

Closure $callback
string $message

Return Value

mixed

Progress progress(string $label, iterable|int $steps, Closure|null $callback = null, string $hint = '')

Display a progress bar.

Parameters

string $label
iterable|int $steps
Closure|null $callback
string $hint

Return Value

Progress

void warning(string|array $message)

No description

Parameters

string|array $message

Return Value

void

void note(string|array $message)

No description

Parameters

string|array $message

Return Value

void

void caution(string|array $message)

No description

Parameters

string|array $message

Return Value

void

mixed askRequired($question)

No description

Parameters

$question

Return Value

mixed