Documentation

StyleInterface

Output style helpers.

Tags
author

Kevin Bond kevinbond@gmail.com

Table of Contents

Methods

ask()  : mixed
Asks a question.
askHidden()  : mixed
Asks a question with the user input hidden.
caution()  : void
Formats a caution admonition.
choice()  : mixed
Asks a choice question.
confirm()  : bool
Asks for confirmation.
error()  : void
Formats an error result bar.
listing()  : void
Formats a list.
newLine()  : void
Add newline(s).
note()  : void
Formats a note admonition.
progressAdvance()  : void
Advances the progress output X steps.
progressFinish()  : void
Finishes the progress output.
progressStart()  : void
Starts the progress output.
section()  : void
Formats a section title.
success()  : void
Formats a success result bar.
table()  : void
Formats a table.
text()  : void
Formats informational text.
title()  : void
Formats a command title.
warning()  : void
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) : void
Parameters
$message : string|array<string|int, mixed>

choice()

Asks a choice question.

public choice(string $question, array<string|int, mixed> $choices[, mixed $default = null ]) : mixed
Parameters
$question : string
$choices : array<string|int, mixed>
$default : mixed = null

confirm()

Asks for confirmation.

public confirm(string $question[, bool $default = true ]) : bool
Parameters
$question : string
$default : bool = true
Return values
bool

error()

Formats an error result bar.

public error(string|array<string|int, mixed> $message) : void
Parameters
$message : string|array<string|int, mixed>

listing()

Formats a list.

public listing(array<string|int, mixed> $elements) : void
Parameters
$elements : array<string|int, mixed>

newLine()

Add newline(s).

public newLine([int $count = 1 ]) : void
Parameters
$count : int = 1

note()

Formats a note admonition.

public note(string|array<string|int, mixed> $message) : void
Parameters
$message : string|array<string|int, mixed>

progressAdvance()

Advances the progress output X steps.

public progressAdvance([int $step = 1 ]) : void
Parameters
$step : int = 1

progressFinish()

Finishes the progress output.

public progressFinish() : void

progressStart()

Starts the progress output.

public progressStart([int $max = 0 ]) : void
Parameters
$max : int = 0

section()

Formats a section title.

public section(string $message) : void
Parameters
$message : string

success()

Formats a success result bar.

public success(string|array<string|int, mixed> $message) : void
Parameters
$message : string|array<string|int, mixed>

table()

Formats a table.

public table(array<string|int, mixed> $headers, array<string|int, mixed> $rows) : void
Parameters
$headers : array<string|int, mixed>
$rows : array<string|int, mixed>

text()

Formats informational text.

public text(string|array<string|int, mixed> $message) : void
Parameters
$message : string|array<string|int, mixed>

title()

Formats a command title.

public title(string $message) : void
Parameters
$message : string

warning()

Formats an warning result bar.

public warning(string|array<string|int, mixed> $message) : void
Parameters
$message : string|array<string|int, mixed>

        
On this page

Search results