Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
Sabberworm\CSS\CSSList\CSSList Class Reference
Inheritance diagram for Sabberworm\CSS\CSSList\CSSList:
Sabberworm\CSS\Renderable Sabberworm\CSS\Comment\Commentable Sabberworm\CSS\CSSList\CSSBlockList Sabberworm\CSS\CSSList\KeyFrame Sabberworm\CSS\CSSList\AtRuleBlockList Sabberworm\CSS\CSSList\Document

Public Member Functions

 __toString ()
 
 addComments (array $aComments)
 
 append ($oItem)
 Appends an item to the list of contents.
 
 getComments ()
 
 getContents ()
 Returns the stored items.
 
 getLineNo ()
 
 insertBefore ($item, $sibling)
 Inserts an item in the CSS list before its sibling.
 
 isRootList ()
 Return true if the list can not be further outdented.
 
 prepend ($oItem)
 Prepends an item to the list of contents.
 
 remove ($oItemToRemove)
 Removes an item from the CSS list.
 
 removeDeclarationBlockBySelector ($mSelector, $bRemoveAll=false)
 Removes a declaration block from the CSS list if it matches all given selectors.
 
 render ($oOutputFormat)
 
 replace ($oOldItem, $mNewItem)
 Replaces an item from the CSS list.
 
 setComments (array $aComments)
 
 setContents (array $aContents)
 
 splice ($iOffset, $iLength=null, $mReplacement=null)
 Splices the list of contents.
 

Static Public Member Functions

static parseList (ParserState $oParserState, CSSList $oList)
 

Public Attributes

$this iLineNo = $iLineNo
 

Protected Member Functions

 renderListContents (OutputFormat $oOutputFormat)
 

Protected Attributes

array< array-key, $aComments;protected array< int, $aContents;protected int $iLineNo;public function __construct( $iLineNo=0) { $this->aComments=[];$this-> aContents = []
 Comment>
 

Member Function Documentation

◆ __toString()

Sabberworm\CSS\CSSList\CSSList::__toString ( )

◆ addComments()

Sabberworm\CSS\CSSList\CSSList::addComments ( array $aComments)
Parameters
array<array-key,Comment>$aComments
Return values
void

Implements Sabberworm\CSS\Comment\Commentable.

◆ append()

Sabberworm\CSS\CSSList\CSSList::append ( $oItem)

Appends an item to the list of contents.

Parameters
RuleSet | CSSList | Import | Charset$oItem
Return values
void

◆ getComments()

Sabberworm\CSS\CSSList\CSSList::getComments ( )
Return values
array<array-key,Comment>

Implements Sabberworm\CSS\Comment\Commentable.

◆ getContents()

Sabberworm\CSS\CSSList\CSSList::getContents ( )

Returns the stored items.

Return values
array<int,RuleSet|Import|Charset|CSSList>

◆ getLineNo()

Sabberworm\CSS\CSSList\CSSList::getLineNo ( )
Return values
int

Implements Sabberworm\CSS\Renderable.

◆ insertBefore()

Sabberworm\CSS\CSSList\CSSList::insertBefore ( $item,
$sibling )

Inserts an item in the CSS list before its sibling.

If the desired sibling cannot be found, the item is appended at the end.

Parameters
RuleSet | CSSList | Import | Charset$item
RuleSet | CSSList | Import | Charset$sibling

◆ isRootList()

Sabberworm\CSS\CSSList\CSSList::isRootList ( )
abstract

Return true if the list can not be further outdented.

Only important when rendering.

Return values
bool

Reimplemented in Sabberworm\CSS\CSSList\AtRuleBlockList, Sabberworm\CSS\CSSList\Document, and Sabberworm\CSS\CSSList\KeyFrame.

◆ parseList()

static Sabberworm\CSS\CSSList\CSSList::parseList ( ParserState $oParserState,
CSSList $oList )
static
Return values
void
Exceptions
UnexpectedTokenException
SourceException

◆ prepend()

Sabberworm\CSS\CSSList\CSSList::prepend ( $oItem)

Prepends an item to the list of contents.

Parameters
RuleSet | CSSList | Import | Charset$oItem
Return values
void

◆ remove()

Sabberworm\CSS\CSSList\CSSList::remove ( $oItemToRemove)

Removes an item from the CSS list.

Parameters
RuleSet | Import | Charset | CSSList$oItemToRemoveMay be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
Return values
boolwhether the item was removed

◆ removeDeclarationBlockBySelector()

Sabberworm\CSS\CSSList\CSSList::removeDeclarationBlockBySelector ( $mSelector,
$bRemoveAll = false )

Removes a declaration block from the CSS list if it matches all given selectors.

Parameters
DeclarationBlock|array<array-key,Selector>|string$mSelector the selectors to match
bool$bRemoveAllwhether to stop at the first declaration block found or remove all blocks
Return values
void

◆ render()

◆ renderListContents()

Sabberworm\CSS\CSSList\CSSList::renderListContents ( OutputFormat $oOutputFormat)
protected
Return values
string

◆ replace()

Sabberworm\CSS\CSSList\CSSList::replace ( $oOldItem,
$mNewItem )

Replaces an item from the CSS list.

Parameters
RuleSet | Import | Charset | CSSList$oOldItemMay be a RuleSet (most likely a DeclarationBlock), an Import, a Charset or another CSSList (most likely a MediaQuery)
Return values
bool

◆ setComments()

Sabberworm\CSS\CSSList\CSSList::setComments ( array $aComments)
Parameters
array<array-key,Comment>$aComments
Return values
void

Implements Sabberworm\CSS\Comment\Commentable.

◆ setContents()

Sabberworm\CSS\CSSList\CSSList::setContents ( array $aContents)
Parameters
array<int,RuleSet|Import|Charset|CSSList>$aContents

◆ splice()

Sabberworm\CSS\CSSList\CSSList::splice ( $iOffset,
$iLength = null,
$mReplacement = null )

Splices the list of contents.

Parameters
int$iOffset
int$iLength
array<int,RuleSet|CSSList|Import|Charset>$mReplacement
Return values
void

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