Documentation

OutputFormatterStyle
in package
implements OutputFormatterStyleInterface

Formatter style class for defining styles.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Interfaces, Classes and Traits

OutputFormatterStyleInterface
Formatter style interface for defining styles.

Table of Contents

$background  : mixed
$color  : mixed
$foreground  : mixed
$handlesHrefGracefully  : mixed
$href  : mixed
$options  : mixed
__construct()  : mixed
Initializes output formatter style.
apply()  : string
Applies the style to a given text.
setBackground()  : mixed
Sets style background color.
setForeground()  : mixed
Sets style foreground color.
setHref()  : void
setOption()  : mixed
Sets some specific style option.
setOptions()  : mixed
Sets multiple style options at once.
unsetOption()  : mixed
Unsets some specific style option.

Properties

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> = []
Return values
mixed

apply()

Applies the style to a given text.

public apply(string $text) : string
Parameters
$text : string
Return values
string

setBackground()

Sets style background color.

public setBackground([string $color = null ]) : mixed
Parameters
$color : string = null
Return values
mixed

setForeground()

Sets style foreground color.

public setForeground([string $color = null ]) : mixed
Parameters
$color : string = null
Return values
mixed

setHref()

public setHref(string $url) : void
Parameters
$url : string
Return values
void

setOption()

Sets some specific style option.

public setOption(string $option) : mixed
Parameters
$option : string
Return values
mixed

setOptions()

Sets multiple style options at once.

public setOptions(array<string|int, mixed> $options) : mixed
Parameters
$options : array<string|int, mixed>
Return values
mixed

unsetOption()

Unsets some specific style option.

public unsetOption(string $option) : mixed
Parameters
$option : string
Return values
mixed

Search results