OutputFormatterStyle
in package
implements
OutputFormatterStyleInterface
Formatter style class for defining styles.
Tags
Table of Contents
Interfaces
- OutputFormatterStyleInterface
- Formatter style interface for defining styles.
Methods
- __construct() : mixed
- Initializes output formatter style.
- apply() : string
- Applies the style to a given text.
- setBackground() : void
- Sets style background color.
- setForeground() : void
- Sets style foreground color.
- setHref() : void
- setOption() : void
- Sets some specific style option.
- setOptions() : void
- Sets multiple style options at once.
- unsetOption() : void
- Unsets some specific style option.
Methods
__construct()
Initializes output formatter style.
public
__construct([string|null $foreground = null ][, string|null $background = null ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $foreground : string|null = null
-
The style foreground color name
- $background : string|null = null
-
The style background color name
- $options : array<string|int, mixed> = []
apply()
Applies the style to a given text.
public
apply(string $text) : string
Parameters
- $text : string
Return values
stringsetBackground()
Sets style background color.
public
setBackground(string|null $color) : void
Parameters
- $color : string|null
setForeground()
Sets style foreground color.
public
setForeground(string|null $color) : void
Parameters
- $color : string|null
setHref()
public
setHref(string $url) : void
Parameters
- $url : string
setOption()
Sets some specific style option.
public
setOption(string $option) : void
Parameters
- $option : string
setOptions()
Sets multiple style options at once.
public
setOptions(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
unsetOption()
Unsets some specific style option.
public
unsetOption(string $option) : void
Parameters
- $option : string