Documentation

SymfonyStyle extends OutputStyle
in package

Output decorator helpers for the Symfony Style Guide.

Tags
author

Kevin Bond kevinbond@gmail.com

Table of Contents

MAX_LINE_LENGTH  = 120
$bufferedOutput  : mixed
$input  : mixed
$lineLength  : mixed
$output  : mixed
$progressBar  : mixed
$questionHelper  : mixed
__construct()  : mixed
ask()  : mixed
{@inheritdoc}
askHidden()  : mixed
{@inheritdoc}
askQuestion()  : mixed
block()  : mixed
Formats a message as a block of text.
caution()  : mixed
{@inheritdoc}
choice()  : mixed
{@inheritdoc}
comment()  : mixed
Formats a command comment.
confirm()  : mixed
{@inheritdoc}
createProgressBar()  : ProgressBar
createTable()  : Table
definitionList()  : mixed
Formats a list of key/value horizontally.
error()  : mixed
{@inheritdoc}
getErrorStyle()  : self
Returns a new instance which makes use of stderr if available.
getFormatter()  : OutputFormatterInterface
Returns current output formatter instance.
getVerbosity()  : int
Gets the current verbosity of the output.
horizontalTable()  : mixed
Formats a horizontal table.
info()  : mixed
Formats an info message.
isDebug()  : bool
Returns whether verbosity is debug (-vvv).
isDecorated()  : bool
Gets the decorated flag.
isQuiet()  : bool
Returns whether verbosity is quiet (-q).
isVerbose()  : bool
Returns whether verbosity is verbose (-v).
isVeryVerbose()  : bool
Returns whether verbosity is very verbose (-vv).
listing()  : mixed
{@inheritdoc}
newLine()  : mixed
Add newline(s).
note()  : mixed
{@inheritdoc}
progressAdvance()  : mixed
{@inheritdoc}
progressFinish()  : mixed
{@inheritdoc}
progressIterate()  : iteratable<string|int, mixed>
progressStart()  : mixed
{@inheritdoc}
section()  : mixed
{@inheritdoc}
setDecorated()  : mixed
Sets the decorated flag.
setFormatter()  : mixed
setVerbosity()  : mixed
Sets the verbosity of the output.
success()  : mixed
{@inheritdoc}
table()  : mixed
{@inheritdoc}
text()  : mixed
{@inheritdoc}
title()  : mixed
{@inheritdoc}
warning()  : mixed
{@inheritdoc}
write()  : mixed
Writes a message to the output.
writeln()  : mixed
Writes a message to the output and adds a newline at the end.
getErrorOutput()  : mixed
autoPrependBlock()  : void
autoPrependText()  : void
createBlock()  : array<string|int, mixed>
getProgressBar()  : ProgressBar
writeBuffer()  : void

Constants

Properties

Methods

ask()

{@inheritdoc}

public ask(string $question[, string|null $default = null ][, callable|null $validator = null ]) : mixed
Parameters
$question : string
$default : string|null = null
$validator : callable|null = null
Return values
mixed

askHidden()

{@inheritdoc}

public askHidden(string $question[, callable|null $validator = null ]) : mixed
Parameters
$question : string
$validator : callable|null = null
Return values
mixed

block()

Formats a message as a block of text.

public block(string|array<string|int, mixed> $messages[, string|null $type = null ][, string|null $style = null ][, string $prefix = ' ' ][, bool $padding = false ][, bool $escape = true ]) : mixed
Parameters
$messages : string|array<string|int, mixed>

The message to write in the block

$type : string|null = null
$style : string|null = null
$prefix : string = ' '
$padding : bool = false
$escape : bool = true
Return values
mixed

caution()

{@inheritdoc}

public caution(mixed $message) : mixed
Parameters
$message : mixed
Return values
mixed

choice()

{@inheritdoc}

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

comment()

Formats a command comment.

public comment(string|array<string|int, mixed> $message) : mixed
Parameters
$message : string|array<string|int, mixed>
Return values
mixed

confirm()

{@inheritdoc}

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

definitionList()

Formats a list of key/value horizontally.

public definitionList(string|array<string|int, mixed>|TableSeparator ...$list) : mixed

Each row can be one of:

  • 'A title'
  • ['key' => 'value']
  • new TableSeparator()
Parameters
$list : string|array<string|int, mixed>|TableSeparator
Return values
mixed

error()

{@inheritdoc}

public error(mixed $message) : mixed
Parameters
$message : mixed
Return values
mixed

getErrorStyle()

Returns a new instance which makes use of stderr if available.

public getErrorStyle() : self
Return values
self

getVerbosity()

Gets the current verbosity of the output.

public getVerbosity() : int
Return values
int

horizontalTable()

Formats a horizontal table.

public horizontalTable(array<string|int, mixed> $headers, array<string|int, mixed> $rows) : mixed
Parameters
$headers : array<string|int, mixed>
$rows : array<string|int, mixed>
Return values
mixed

info()

Formats an info message.

public info(string|array<string|int, mixed> $message) : mixed
Parameters
$message : string|array<string|int, mixed>
Return values
mixed

isDebug()

Returns whether verbosity is debug (-vvv).

public isDebug() : bool
Return values
bool

isDecorated()

Gets the decorated flag.

public isDecorated() : bool
Return values
bool

isQuiet()

Returns whether verbosity is quiet (-q).

public isQuiet() : bool
Return values
bool

isVerbose()

Returns whether verbosity is verbose (-v).

public isVerbose() : bool
Return values
bool

isVeryVerbose()

Returns whether verbosity is very verbose (-vv).

public isVeryVerbose() : bool
Return values
bool

listing()

{@inheritdoc}

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

newLine()

Add newline(s).

public newLine([int $count = 1 ]) : mixed
Parameters
$count : int = 1
Return values
mixed

note()

{@inheritdoc}

public note(mixed $message) : mixed
Parameters
$message : mixed
Return values
mixed

progressAdvance()

{@inheritdoc}

public progressAdvance([int $step = 1 ]) : mixed
Parameters
$step : int = 1
Return values
mixed

progressFinish()

{@inheritdoc}

public progressFinish() : mixed
Return values
mixed

progressIterate()

public progressIterate(iteratable<string|int, mixed> $iterable[, int|null $max = null ]) : iteratable<string|int, mixed>
Parameters
$iterable : iteratable<string|int, mixed>
$max : int|null = null
Tags
see
ProgressBar::iterate()
Return values
iteratable<string|int, mixed>

progressStart()

{@inheritdoc}

public progressStart(int $max) : mixed
Parameters
$max : int
Return values
mixed

section()

{@inheritdoc}

public section(string $message) : mixed
Parameters
$message : string
Return values
mixed

setDecorated()

Sets the decorated flag.

public setDecorated(bool $decorated) : mixed
Parameters
$decorated : bool
Return values
mixed

setVerbosity()

Sets the verbosity of the output.

public setVerbosity(int $level) : mixed
Parameters
$level : int
Return values
mixed

success()

{@inheritdoc}

public success(mixed $message) : mixed
Parameters
$message : mixed
Return values
mixed

table()

{@inheritdoc}

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

text()

{@inheritdoc}

public text(mixed $message) : mixed
Parameters
$message : mixed
Return values
mixed

title()

{@inheritdoc}

public title(string $message) : mixed
Parameters
$message : string
Return values
mixed

warning()

{@inheritdoc}

public warning(mixed $message) : mixed
Parameters
$message : mixed
Return values
mixed

write()

Writes a message to the output.

public write(mixed $messages[, bool $newline = false ][, int $type = self::OUTPUT_NORMAL ]) : mixed
Parameters
$messages : mixed

The message as an iterable of strings or a single string

$newline : bool = false

Whether to add a newline

$type : int = self::OUTPUT_NORMAL
Return values
mixed

writeln()

Writes a message to the output and adds a newline at the end.

public writeln(mixed $messages[, int $type = self::OUTPUT_NORMAL ]) : mixed
Parameters
$messages : mixed

The message as an iterable of strings or a single string

$type : int = self::OUTPUT_NORMAL
Return values
mixed

getErrorOutput()

protected getErrorOutput() : mixed
Return values
mixed

autoPrependBlock()

private autoPrependBlock() : void
Return values
void

autoPrependText()

private autoPrependText() : void
Return values
void

createBlock()

private createBlock(iteratable<string|int, mixed> $messages[, string|null $type = null ][, string|null $style = null ][, string $prefix = ' ' ][, bool $padding = false ][, bool $escape = false ]) : array<string|int, mixed>
Parameters
$messages : iteratable<string|int, mixed>
$type : string|null = null
$style : string|null = null
$prefix : string = ' '
$padding : bool = false
$escape : bool = false
Return values
array<string|int, mixed>

writeBuffer()

private writeBuffer(string $message, bool $newLine, int $type) : void
Parameters
$message : string
$newLine : bool
$type : int
Return values
void

Search results