Sabberworm\CSS\RuleSet\RuleSet
RuleSet is a generic superclass denoting rules. The typical example for rule sets are declaration block.
However, unknown At-Rules (like @font-face) are also rule sets.
Synopsis
class RuleSet
implements
Renderable,Commentable
{
- // members
- private $aRules;
- protected $iLineNo;
- protected $aComments;
- // methods
- public void __construct()
- public int getLineNo()
- public void addRule()
- public void getRules()
- public void setRules()
- public void getRulesAssoc()
- public void removeRule()
- public void __toString()
- public void render()
- public void addComments()
- public array getComments()
- public void setComments()
Hierarchy
Members
private
- $aRules
protected
- $aComments
- $iLineNo
Methods
public
- __construct()
- __toString()
- addComments()
- addRule()
- getComments()
- getLineNo()
- getRules() — Returns all rules matching the given rule name
- getRulesAssoc() — 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.
- removeRule() — Remove a rule from this RuleSet. This accepts all the possible values that @link{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 behvaiour, use removeRule($oRule->getRule()).
- render()
- setComments()
- setRules() — Override all the rules of this set.