css-sanitizer
Classes to parse and sanitize CSS
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. More...
 
 getName ()
 Return the declaration's name. More...
 
 getValue ()
 Return the declaration's value. More...
 
 getImportant ()
 Return the declaration's 'important' flag. More...
 
 setImportant ( $flag)
 Set the 'important' flag. More...
 
 toTokenArray ()
 @inheritDoc
 
 toComponentValueArray ()
 @inheritDoc
 
 __toString ()
 

Public Attributes

 $pos = -1
 

Protected Attributes

 $line = -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

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