Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
Sabberworm\CSS\CSSList\Document Class Reference
Inheritance diagram for Sabberworm\CSS\CSSList\Document:
Sabberworm\CSS\CSSList\CSSBlockList Sabberworm\CSS\CSSList\CSSList Sabberworm\CSS\Renderable Sabberworm\CSS\Comment\Commentable

Public Member Functions

 __construct ($iLineNo=0)
 
 __toString ()
 
 addComments (array $aComments)
 
 append ($oItem)
 Appends an item to tje list of contents.
 
 createShorthands ()
 Create shorthands properties whenever possible.
 
 expandShorthands ()
 Expands all shorthand properties to their long value.
 
 getAllDeclarationBlocks ()
 Gets all DeclarationBlock objects recursively.
 
 getAllRuleSets ()
 Returns all RuleSet objects found recursively in the tree.
 
 getAllSelectors ()
 Gets all DeclarationBlock objects recursively.
 
 getAllValues ($mElement=null, $bSearchInFunctionArguments=false)
 Returns all Value objects found recursively in the tree.
 
 getComments ()
 
 getContents ()
 
 getLineNo ()
 
 getSelectorsBySpecificity ($sSpecificitySearch=null)
 
 insert ($oItem, $oSibling)
 Insert an item before its sibling.
 
 isRootList ()
 
 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 (OutputFormat $oOutputFormat=null)
 Overrides render() to make format argument optional.
 
 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 parse (ParserState $oParserState)
 
static parseList (ParserState $oParserState, CSSList $oList)
 

Public Attributes

$this iLineNo = $iLineNo
 

Protected Member Functions

 allDeclarationBlocks (array &$aResult)
 
 allRuleSets (array &$aResult)
 
 allSelectors (array &$aResult, $sSpecificitySearch=null)
 
 allValues ($oElement, array &$aResult, $sSearchString=null, $bSearchInFunctionArguments=false)
 

Protected Attributes

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

Constructor & Destructor Documentation

◆ __construct()

Sabberworm\CSS\CSSList\Document::__construct ( $iLineNo = 0)
Parameters
int$iLineNo

Reimplemented from Sabberworm\CSS\CSSList\CSSBlockList.

Member Function Documentation

◆ __toString()

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

◆ addComments()

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

Implements Sabberworm\CSS\Comment\Commentable.

◆ allDeclarationBlocks()

Sabberworm\CSS\CSSList\CSSBlockList::allDeclarationBlocks ( array & $aResult)
protectedinherited
Parameters
array<int,DeclarationBlock>$aResult
Return values
void

◆ allRuleSets()

Sabberworm\CSS\CSSList\CSSBlockList::allRuleSets ( array & $aResult)
protectedinherited
Parameters
array<int,RuleSet>$aResult
Return values
void

◆ allSelectors()

Sabberworm\CSS\CSSList\CSSBlockList::allSelectors ( array & $aResult,
$sSpecificitySearch = null )
protectedinherited
Parameters
array<int,Selector>$aResult
string | null$sSpecificitySearch
Return values
void

◆ allValues()

Sabberworm\CSS\CSSList\CSSBlockList::allValues ( $oElement,
array & $aResult,
$sSearchString = null,
$bSearchInFunctionArguments = false )
protectedinherited
Parameters
CSSList | Rule | RuleSet | Value$oElement
array<int,Value>$aResult
string | null$sSearchString
bool$bSearchInFunctionArguments
Return values
void

◆ append()

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

Appends an item to tje list of contents.

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

◆ createShorthands()

Sabberworm\CSS\CSSList\Document::createShorthands ( )

Create shorthands properties whenever possible.

Return values
void

◆ expandShorthands()

Sabberworm\CSS\CSSList\Document::expandShorthands ( )

Expands all shorthand properties to their long value.

Return values
void

◆ getAllDeclarationBlocks()

Sabberworm\CSS\CSSList\Document::getAllDeclarationBlocks ( )

Gets all DeclarationBlock objects recursively.

Return values
array<int,DeclarationBlock>

◆ getAllRuleSets()

Sabberworm\CSS\CSSList\Document::getAllRuleSets ( )

Returns all RuleSet objects found recursively in the tree.

Return values
array<int,RuleSet>

◆ getAllSelectors()

Sabberworm\CSS\CSSList\Document::getAllSelectors ( )

Gets all DeclarationBlock objects recursively.

Return values
array<int,DeclarationBlock>
Deprecated
will be removed in version 9.0; use getAllDeclarationBlocks() instead

◆ getAllValues()

Sabberworm\CSS\CSSList\Document::getAllValues ( $mElement = null,
$bSearchInFunctionArguments = false )

Returns all Value objects found recursively in the tree.

Parameters
CSSList | RuleSet | string$mElementthe CSSList or RuleSet to start the search from (defaults to the whole document). If a string is given, it is used as rule name filter.
bool$bSearchInFunctionArgumentswhether to also return Value objects used as Function arguments.
Return values
array<int,Value>
See also
RuleSet->getRules()

◆ getComments()

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

Implements Sabberworm\CSS\Comment\Commentable.

◆ getContents()

Sabberworm\CSS\CSSList\CSSList::getContents ( )
inherited
Return values
array<int,RuleSet|Import|Charset|CSSList>

◆ getLineNo()

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

Implements Sabberworm\CSS\Renderable.

◆ insert()

Sabberworm\CSS\CSSList\CSSList::insert ( $oItem,
$oSibling )
inherited

Insert an item before its sibling.

Parameters
mixed$oItemThe item.
mixed$oSiblingThe sibling.

◆ isRootList()

Sabberworm\CSS\CSSList\Document::isRootList ( )
Return values
bool

Reimplemented from Sabberworm\CSS\CSSList\CSSList.

◆ parse()

static Sabberworm\CSS\CSSList\Document::parse ( ParserState $oParserState)
static
Return values
Document
Exceptions
SourceException

◆ parseList()

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

◆ prepend()

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

Prepends an item to the list of contents.

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

◆ remove()

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

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 )
inherited

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()

Sabberworm\CSS\CSSList\Document::render ( OutputFormat $oOutputFormat = null)

Overrides render() to make format argument optional.

Parameters
OutputFormat | null$oOutputFormat
Return values
string

Reimplemented from Sabberworm\CSS\CSSList\CSSList.

◆ replace()

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

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)
inherited
Parameters
array<array-key,Comment>$aComments
Return values
void

Implements Sabberworm\CSS\Comment\Commentable.

◆ setContents()

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

◆ splice()

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

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: