OutputFormatterInterface
in
Formatter interface for console output.
Tags
Table of Contents
Methods
- format() : string
- Formats a message according to the given styles.
- getStyle() : OutputFormatterStyleInterface
- Gets style options from style with specified name.
- hasStyle() : bool
- Checks if output formatter has style with specified name.
- isDecorated() : bool
- Gets the decorated flag.
- setDecorated() : mixed
- Sets the decorated flag.
- setStyle() : mixed
- Sets a new style.
Methods
format()
Formats a message according to the given styles.
public
format(string $message) : string
Parameters
- $message : string
-
The message to style
Return values
string —The styled message
getStyle()
Gets style options from style with specified name.
public
getStyle(string $name) : OutputFormatterStyleInterface
Parameters
- $name : string
Tags
Return values
OutputFormatterStyleInterfacehasStyle()
Checks if output formatter has style with specified name.
public
hasStyle(string $name) : bool
Parameters
- $name : string
Return values
boolisDecorated()
Gets the decorated flag.
public
isDecorated() : bool
Return values
bool —true if the output will decorate messages, false otherwise
setDecorated()
Sets the decorated flag.
public
setDecorated(bool $decorated) : mixed
Parameters
- $decorated : bool
-
Whether to decorate the messages or not
setStyle()
Sets a new style.
public
setStyle(string $name, OutputFormatterStyleInterface $style) : mixed
Parameters
- $name : string
-
The style name
- $style : OutputFormatterStyleInterface