PHP Класс Webmozart\Console\Api\Formatter\StyleSet

С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $styles = [] ) Creates a new style set.
add ( Style $style ) Adds a style.
clear ( ) Clears the contents of the style set.
contains ( string $tag ) : boolean Returns whether the style with the given tag exists.
get ( string $tag ) : Style Returns the style with the given tag.
isEmpty ( ) : boolean Returns whether the style set is empty.
merge ( array $styles ) Adds styles to the style set.
remove ( string $tag ) Removes a style.
replace ( array $styles ) Sets the styles of the style set.
toArray ( ) : Style[] Returns all styles.

Описание методов

__construct() публичный Метод

Creates a new style set.
public __construct ( array $styles = [] )
$styles array The styles to add.

add() публичный Метод

Adds a style.
public add ( Style $style )
$style Style The style to add.

clear() публичный Метод

Clears the contents of the style set.
public clear ( )

contains() публичный Метод

Returns whether the style with the given tag exists.
public contains ( string $tag ) : boolean
$tag string The tag of the style.
Результат boolean Returns `true` if a style with the given tag exists and `false` otherwise.

get() публичный Метод

Returns the style with the given tag.
public get ( string $tag ) : Style
$tag string The tag of the style.
Результат Style The style.

isEmpty() публичный Метод

Returns whether the style set is empty.
public isEmpty ( ) : boolean
Результат boolean Returns `true` if the set contains no styles and `false` otherwise.

merge() публичный Метод

Existing styles are preserved.
public merge ( array $styles )
$styles array The styles to add.

remove() публичный Метод

This method does nothing if the tag does not exist.
public remove ( string $tag )
$tag string The tag of the style.

replace() публичный Метод

Existing styles are removed.
public replace ( array $styles )
$styles array The styles to set.

toArray() публичный Метод

Returns all styles.
public toArray ( ) : Style[]
Результат Style[] The styles indexed by their tags.