PHP Class Sabberworm\CSS\CSSList\CSSList

Also, it may contain Import and Charset objects stemming from @-rules.
Show file Open project: sabberworm/php-css-parser Class Usage Examples

Protected Properties

Property Type Description
$aComments
$aContents
$iLineNo

Public Methods

Method Description
__construct ( $iLineNo )
__toString ( )
addComments ( array $aComments )
append ( $oItem )
getComments ( ) : array
getContents ( )
getLineNo ( ) : integer
isRootList ( ) Return true if the list can not be further outdented. Only important when rendering.
remove ( Sabberworm\CSS\RuleSet\RuleSet | Import | Charset | CSSList $oItemToRemove ) Removes an item from the CSS list.
removeDeclarationBlockBySelector ( array | string $mSelector, boolean $bRemoveAll = false ) Removes a declaration block from the CSS list if it matches all given selectors.
render ( Sabberworm\CSS\OutputFormat $oOutputFormat )
setComments ( array $aComments )
setContents ( array $aContents ) Set the contents.

Method Details

__construct() public method

public __construct ( $iLineNo )

__toString() public method

public __toString ( )

addComments() public method

public addComments ( array $aComments )
$aComments array Array of comments.

append() public method

public append ( $oItem )

getComments() public method

public getComments ( ) : array
return array

getContents() public method

public getContents ( )

getLineNo() public method

public getLineNo ( ) : integer
return integer

isRootList() abstract public method

Return true if the list can not be further outdented. Only important when rendering.
abstract public isRootList ( )

remove() public method

Removes an item from the CSS list.
public remove ( Sabberworm\CSS\RuleSet\RuleSet | Import | Charset | CSSList $oItemToRemove )
$oItemToRemove Sabberworm\CSS\RuleSet\RuleSet | Import | Charset | CSSList May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)

removeDeclarationBlockBySelector() public method

Removes a declaration block from the CSS list if it matches all given selectors.
public removeDeclarationBlockBySelector ( array | string $mSelector, boolean $bRemoveAll = false )
$mSelector array | string The selectors to match.
$bRemoveAll boolean Whether to stop at the first declaration block found or remove all blocks

render() public method

public render ( Sabberworm\CSS\OutputFormat $oOutputFormat )
$oOutputFormat Sabberworm\CSS\OutputFormat

setComments() public method

public setComments ( array $aComments )
$aComments array Array containing Comment objects.

setContents() public method

Set the contents.
public setContents ( array $aContents )
$aContents array Objects to set as content.

Property Details

$aComments protected property

protected $aComments

$aContents protected property

protected $aContents

$iLineNo protected property

protected $iLineNo