interface StyleInterface

Output style helpers.

Methods

title(string $message)

Formats a command title.

section(string $message)

Formats a section title.

listing(array $elements)

Formats a list.

text(string|array $message)

Formats informational text.

success(string|array $message)

Formats a success result bar.

error(string|array $message)

Formats an error result bar.

warning(string|array $message)

Formats an warning result bar.

note(string|array $message)

Formats a note admonition.

caution(string|array $message)

Formats a caution admonition.

table(array $headers, array $rows)

Formats a table.

mixed
ask(string $question, string|null $default = null, callable|null $validator = null)

Asks a question.

mixed
askHidden(string $question, callable|null $validator = null)

Asks a question with the user input hidden.

bool
confirm(string $question, bool $default = true)

Asks for confirmation.

mixed
choice(string $question, array $choices, string|int|null $default = null)

Asks a choice question.

newLine(int $count = 1)

Add newline(s).

progressStart(int $max = 0)

Starts the progress output.

progressAdvance(int $step = 1)

Advances the progress output X steps.

progressFinish()

Finishes the progress output.

Details

at line 26
title(string $message)

Formats a command title.

Parameters

string $message

at line 33
section(string $message)

Formats a section title.

Parameters

string $message

at line 38
listing(array $elements)

Formats a list.

Parameters

array $elements

at line 45
text(string|array $message)

Formats informational text.

Parameters

string|array $message

at line 52
success(string|array $message)

Formats a success result bar.

Parameters

string|array $message

at line 59
error(string|array $message)

Formats an error result bar.

Parameters

string|array $message

at line 66
warning(string|array $message)

Formats an warning result bar.

Parameters

string|array $message

at line 73
note(string|array $message)

Formats a note admonition.

Parameters

string|array $message

at line 80
caution(string|array $message)

Formats a caution admonition.

Parameters

string|array $message

at line 85
table(array $headers, array $rows)

Formats a table.

Parameters

array $headers
array $rows

at line 96
mixed ask(string $question, string|null $default = null, callable|null $validator = null)

Asks a question.

Parameters

string $question
string|null $default
callable|null $validator

Return Value

mixed

at line 106
mixed askHidden(string $question, callable|null $validator = null)

Asks a question with the user input hidden.

Parameters

string $question
callable|null $validator

Return Value

mixed

at line 116
bool confirm(string $question, bool $default = true)

Asks for confirmation.

Parameters

string $question
bool $default

Return Value

bool

at line 127
mixed choice(string $question, array $choices, string|int|null $default = null)

Asks a choice question.

Parameters

string $question
array $choices
string|int|null $default

Return Value

mixed

at line 134
newLine(int $count = 1)

Add newline(s).

Parameters

int $count The number of newlines

at line 141
progressStart(int $max = 0)

Starts the progress output.

Parameters

int $max Maximum steps (0 if unknown)

at line 148
progressAdvance(int $step = 1)

Advances the progress output X steps.

Parameters

int $step Number of steps to advance

at line 153
progressFinish()

Finishes the progress output.