PHP 클래스 Webmozart\Console\Api\Formatter\StyleSet

부터: 1.0
저자: Bernhard Schussek ([email protected])
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__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.