Documentation

OutputFormatterStyleInterface

Formatter style interface for defining styles.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Table of Contents

Methods

apply()  : string
Applies the style to a given text.
setBackground()  : mixed
Sets style background color.
setForeground()  : mixed
Sets style foreground color.
setOption()  : mixed
Sets some specific style option.
setOptions()  : mixed
Sets multiple style options at once.
unsetOption()  : mixed
Unsets some specific style option.

Methods

apply()

Applies the style to a given text.

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

The text to style

Return values
string

setBackground()

Sets style background color.

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

The color name

setForeground()

Sets style foreground color.

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

The color name

setOption()

Sets some specific style option.

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

The option name

setOptions()

Sets multiple style options at once.

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

unsetOption()

Unsets some specific style option.

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

The option name


        
On this page

Search results