StyleInterface
in
Output style helpers.
Tags
Table of Contents
Methods
- ask() : mixed
- Asks a question.
- askHidden() : mixed
- Asks a question with the user input hidden.
- caution() : mixed
- Formats a caution admonition.
- choice() : mixed
- Asks a choice question.
- confirm() : bool
- Asks for confirmation.
- error() : mixed
- Formats an error result bar.
- listing() : mixed
- Formats a list.
- newLine() : mixed
- Add newline(s).
- note() : mixed
- Formats a note admonition.
- progressAdvance() : mixed
- Advances the progress output X steps.
- progressFinish() : mixed
- Finishes the progress output.
- progressStart() : mixed
- Starts the progress output.
- section() : mixed
- Formats a section title.
- success() : mixed
- Formats a success result bar.
- table() : mixed
- Formats a table.
- text() : mixed
- Formats informational text.
- title() : mixed
- Formats a command title.
- warning() : mixed
- Formats an warning result bar.
Methods
ask()
Asks a question.
public
ask(string $question[, string|null $default = null ][, callable|null $validator = null ]) : mixed
Parameters
- $question : string
- $default : string|null = null
- $validator : callable|null = null
askHidden()
Asks a question with the user input hidden.
public
askHidden(string $question[, callable|null $validator = null ]) : mixed
Parameters
- $question : string
- $validator : callable|null = null
caution()
Formats a caution admonition.
public
caution(string|array<string|int, mixed> $message) : mixed
Parameters
- $message : string|array<string|int, mixed>
choice()
Asks a choice question.
public
choice(string $question, array<string|int, mixed> $choices[, string|int|null $default = null ]) : mixed
Parameters
- $question : string
- $choices : array<string|int, mixed>
- $default : string|int|null = null
confirm()
Asks for confirmation.
public
confirm(string $question[, bool $default = true ]) : bool
Parameters
- $question : string
- $default : bool = true
Return values
boolerror()
Formats an error result bar.
public
error(string|array<string|int, mixed> $message) : mixed
Parameters
- $message : string|array<string|int, mixed>
listing()
Formats a list.
public
listing(array<string|int, mixed> $elements) : mixed
Parameters
- $elements : array<string|int, mixed>
newLine()
Add newline(s).
public
newLine([int $count = 1 ]) : mixed
Parameters
- $count : int = 1
-
The number of newlines
note()
Formats a note admonition.
public
note(string|array<string|int, mixed> $message) : mixed
Parameters
- $message : string|array<string|int, mixed>
progressAdvance()
Advances the progress output X steps.
public
progressAdvance([int $step = 1 ]) : mixed
Parameters
- $step : int = 1
-
Number of steps to advance
progressFinish()
Finishes the progress output.
public
progressFinish() : mixed
progressStart()
Starts the progress output.
public
progressStart([int $max = 0 ]) : mixed
Parameters
- $max : int = 0
-
Maximum steps (0 if unknown)
section()
Formats a section title.
public
section(string $message) : mixed
Parameters
- $message : string
success()
Formats a success result bar.
public
success(string|array<string|int, mixed> $message) : mixed
Parameters
- $message : string|array<string|int, mixed>
table()
Formats a table.
public
table(array<string|int, mixed> $headers, array<string|int, mixed> $rows) : mixed
Parameters
- $headers : array<string|int, mixed>
- $rows : array<string|int, mixed>
text()
Formats informational text.
public
text(string|array<string|int, mixed> $message) : mixed
Parameters
- $message : string|array<string|int, mixed>
title()
Formats a command title.
public
title(string $message) : mixed
Parameters
- $message : string
warning()
Formats an warning result bar.
public
warning(string|array<string|int, mixed> $message) : mixed
Parameters
- $message : string|array<string|int, mixed>