class ColorProcessor implements ColorProcessorInterface (View source)

Class ColorProcessor.

Properties

boolean $noColors Flag to remove color codes from the output

Methods

__construct()

Class constructor

addStyle(string $name, ColorStyle $style)

Add a style.

static string
stripColors(string $string)

Strip color tags from a string.

string
process(string $string)

Process a string.

boolean
getNoColors()

Method to get property NoColors

setNoColors(boolean $noColors)

Method to set property noColors

Details

at line line 55
__construct()

Class constructor

at line line 70
ColorProcessor addStyle(string $name, ColorStyle $style)

Add a style.

Parameters

string $name The style name.
ColorStyle $style The color style.

Return Value

ColorProcessor Instance of $this to allow chaining.

at line line 86
static string stripColors(string $string)

Strip color tags from a string.

Parameters

string $string The string.

Return Value

string

at line line 100
string process(string $string)

Process a string.

Parameters

string $string The string to process.

Return Value

string

at line line 183
boolean getNoColors()

Method to get property NoColors

Return Value

boolean

at line line 195
ColorProcessorInterface setNoColors(boolean $noColors)

Method to set property noColors

Parameters

boolean $noColors

Return Value

ColorProcessorInterface Return self to support chaining.