css-sanitizer
Classes to parse and sanitize CSS
Loading...
Searching...
No Matches
Wikimedia\CSS\Objects\Declaration Class Reference

Represent a CSS declaration. More...

+ Inheritance diagram for Wikimedia\CSS\Objects\Declaration:
+ Collaboration diagram for Wikimedia\CSS\Objects\Declaration:

Public Member Functions

 __construct (Token $token)
 
 __clone ()
 
 getPosition ()
 Get the position of this Declaration in the input stream.
 
 getName ()
 Return the declaration's name.
 
 getValue ()
 Return the declaration's value.
 
 getImportant ()
 Return the declaration's 'important' flag.
 
 setImportant ( $flag)
 Set the 'important' flag.
 
 toTokenArray ()
 @inheritDoc
 
 toComponentValueArray ()
 @inheritDoc
 
 __toString ()
 

Protected Attributes

 $line = -1
 
 $pos = -1
 
 $name
 
 $value
 
 $important = false
 

Detailed Description

Represent a CSS declaration.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\CSS\Objects\Declaration::__construct ( Token $token)
Parameters
Token$tokenToken starting the declaration

Member Function Documentation

◆ getImportant()

Wikimedia\CSS\Objects\Declaration::getImportant ( )

Return the declaration's 'important' flag.

Returns
bool

◆ getName()

Wikimedia\CSS\Objects\Declaration::getName ( )

Return the declaration's name.

Returns
string

◆ getPosition()

Wikimedia\CSS\Objects\Declaration::getPosition ( )

Get the position of this Declaration in the input stream.

Returns
array [ $line, $pos ]

Implements Wikimedia\CSS\Objects\CSSObject.

◆ getValue()

Wikimedia\CSS\Objects\Declaration::getValue ( )

Return the declaration's value.

Returns
ComponentValueList

◆ setImportant()

Wikimedia\CSS\Objects\Declaration::setImportant ( $flag)

Set the 'important' flag.

Parameters
bool$flag

◆ toComponentValueArray()

Wikimedia\CSS\Objects\Declaration::toComponentValueArray ( )

@inheritDoc

Implements Wikimedia\CSS\Objects\CSSObject.

◆ toTokenArray()

Wikimedia\CSS\Objects\Declaration::toTokenArray ( )

@inheritDoc

Implements Wikimedia\CSS\Objects\CSSObject.


The documentation for this class was generated from the following file: