◆ __toString()
Sabberworm\CSS\RuleSet\RuleSet::__toString |
( |
| ) |
|
◆ addComments()
Sabberworm\CSS\RuleSet\RuleSet::addComments |
( |
array | $aComments | ) |
|
◆ addRule()
Sabberworm\CSS\RuleSet\RuleSet::addRule |
( |
Rule | $oRule, |
|
|
Rule | $oSibling = null ) |
◆ getComments()
Sabberworm\CSS\RuleSet\RuleSet::getComments |
( |
| ) |
|
◆ getLineNo()
Sabberworm\CSS\RuleSet\RuleSet::getLineNo |
( |
| ) |
|
◆ getRulesAssoc()
Sabberworm\CSS\RuleSet\RuleSet::getRulesAssoc |
( |
| $mRule = null | ) |
|
Returns all rules matching the given pattern and returns them in an associative array with the rule’s name as keys.
This method exists mainly for backwards-compatibility and is really only partially useful.
Note: This method loses some information: Calling this (with an argument of background-
) on a declaration block like { background-color: green; background-color; rgba(0, 127, 0, 0.7); }
will only yield an associative array containing the rgba-valued rule while getRules()
would yield an indexed array containing both.
- Parameters
-
Rule | string | null | $mRule | $mRule Pattern to search for. If null, returns all rules. If the pattern ends with a dash, all rules starting with the pattern are returned as well as one matching the pattern with the dash excluded. Passing a Rule behaves like calling getRules($mRule->getRule()) . |
- Return values
-
◆ parseRuleSet()
static Sabberworm\CSS\RuleSet\RuleSet::parseRuleSet |
( |
ParserState | $oParserState, |
|
|
RuleSet | $oRuleSet ) |
|
static |
- Return values
-
- Exceptions
-
UnexpectedTokenException | |
UnexpectedEOFException | |
◆ removeRule()
Sabberworm\CSS\RuleSet\RuleSet::removeRule |
( |
| $mRule | ) |
|
Removes a rule from this RuleSet.
This accepts all the possible values that getRules()
accepts.
If given a Rule, it will only remove this particular rule (by identity). If given a name, it will remove all rules by that name.
Note: this is different from pre-v.2.0 behaviour of PHP-CSS-Parser, where passing a Rule instance would remove all rules with the same name. To get the old behaviour, use removeRule($oRule->getRule())
.
- Parameters
-
Rule | string | null | $mRule | pattern to remove. If $mRule is null, all rules are removed. If the pattern ends in a dash, all rules starting with the pattern are removed as well as one matching the pattern with the dash excluded. Passing a Rule behaves matches by identity. |
- Return values
-
◆ render()
Sabberworm\CSS\RuleSet\RuleSet::render |
( |
OutputFormat | $oOutputFormat | ) |
|
◆ setComments()
Sabberworm\CSS\RuleSet\RuleSet::setComments |
( |
array | $aComments | ) |
|
◆ setRules()
Sabberworm\CSS\RuleSet\RuleSet::setRules |
( |
array | $aRules | ) |
|
Overrides all the rules of this set.
- Parameters
-
array<array-key,Rule> | $aRules The rules to override with. |
- Return values
-
The documentation for this class was generated from the following file:
- lib/php-css-parser/RuleSet/RuleSet.php