interface OutputFormatterInterface

Formatter interface for console output.

Methods

void
setDecorated(bool$decorated)

Sets the decorated flag.

bool
isDecorated()

Whether the output will decorate messages.

void
setStyle(string$name,OutputFormatterStyleInterface$style)

Sets a new style.

bool
hasStyle(string$name)

Checks if output formatter has style with specified name.

getStyle(string$name)

Gets style options from style with specified name.

string|null
format(string|null$message)

Formats a message according to the given styles.

Details

void setDecorated(bool$decorated)

Sets the decorated flag.

Parameters

bool $decorated

Return Value

void

bool isDecorated()

Whether the output will decorate messages.

Return Value

bool

void setStyle(string$name,OutputFormatterStyleInterface$style)

Sets a new style.

Parameters

string $name
OutputFormatterStyleInterface $style

Return Value

void

bool hasStyle(string$name)

Checks if output formatter has style with specified name.

Parameters

string $name

Return Value

bool

OutputFormatterStyleInterface getStyle(string$name)

Gets style options from style with specified name.

Parameters

string $name

Return Value

OutputFormatterStyleInterface

Exceptions

InvalidArgumentException When style isn't defined

string|null format(string|null$message)

Formats a message according to the given styles.

Parameters

string|null $message

Return Value

string|null