Documentation

TrimmedBufferOutput extends Output
in package

A BufferedOutput that keeps only the last N chars.

Tags
author

Jérémy Derussé jeremy@derusse.com

Table of Contents

$buffer  : mixed
$formatter  : mixed
$maxLength  : mixed
$verbosity  : mixed
__construct()  : mixed
fetch()  : string
Empties buffer and returns its content.
getFormatter()  : OutputFormatterInterface
Returns current output formatter instance.
getVerbosity()  : int
Gets the current verbosity of the output.
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).
setDecorated()  : mixed
Sets the decorated flag.
setFormatter()  : mixed
setVerbosity()  : mixed
Sets the verbosity of the output.
write()  : mixed
Writes a message to the output.
writeln()  : mixed
Writes a message to the output and adds a newline at the end.
doWrite()  : mixed
Writes a message to the output.

Properties

$formatter

private mixed $formatter

$verbosity

private mixed $verbosity

Methods

__construct()

public __construct(int $maxLength[, int|null $verbosity = self::VERBOSITY_NORMAL ][, bool $decorated = false ][, OutputFormatterInterface $formatter = null ]) : mixed
Parameters
$maxLength : int
$verbosity : int|null = self::VERBOSITY_NORMAL

The verbosity level (one of the VERBOSITY constants in OutputInterface)

$decorated : bool = false

Whether to decorate messages

$formatter : OutputFormatterInterface = null

Output formatter instance (null to use default OutputFormatter)

Return values
mixed

fetch()

Empties buffer and returns its content.

public fetch() : string
Return values
string

getVerbosity()

Gets the current verbosity of the output.

public getVerbosity() : int
Return values
int

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

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

write()

Writes a message to the output.

public write(mixed $messages[, bool $newline = false ][, int $options = 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

$options : int = self::OUTPUT_NORMAL

A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL

Return values
mixed

writeln()

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

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

The message as an iterable of strings or a single string

$options : int = self::OUTPUT_NORMAL

A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL

Return values
mixed

doWrite()

Writes a message to the output.

protected doWrite(string $message, bool $newline) : mixed
Parameters
$message : string
$newline : bool
Return values
mixed

Search results