interface WrappableOutputFormatterInterface implements OutputFormatterInterface

Formatter interface for console output that supports word wrapping.

Methods

setDecorated(bool $decorated)

Sets the decorated flag.

bool
isDecorated()

Gets the decorated flag.

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
format(string $message)

Formats a message according to the given styles.

formatAndWrap(string $message, int $width)

Formats a message according to the given styles, wrapping at $width (0 means no wrapping).

Details

setDecorated(bool $decorated)

Sets the decorated flag.

Parameters

bool $decorated Whether to decorate the messages or not

bool isDecorated()

Gets the decorated flag.

Return Value

bool true if the output will decorate messages, false otherwise

setStyle(string $name, OutputFormatterStyleInterface $style)

Sets a new style.

Parameters

string $name The style name
OutputFormatterStyleInterface $style The style instance

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 format(string $message)

Formats a message according to the given styles.

Parameters

string $message The message to style

Return Value

string The styled message

at line 24
formatAndWrap(string $message, int $width)

Formats a message according to the given styles, wrapping at $width (0 means no wrapping).

Parameters

string $message
int $width