You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/Sabberworm/CSS/RuleSet/RuleSet.php
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,7 @@ public function addRule(Rule $oRule, Rule $oSibling = null) {
89
89
* @param (null|string|Rule) $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()).
90
90
* @example $oRuleSet->getRules('font-') //returns an array of all rules either beginning with font- or matching font.
91
91
* @example $oRuleSet->getRules('font') //returns array(0 => $oRule, …) or array().
92
+
* @return Rule[] Rules.
92
93
*/
93
94
publicfunctiongetRules($mRule = null) {
94
95
if ($mRuleinstanceof Rule) {
@@ -106,7 +107,7 @@ public function getRules($mRule = null) {
106
107
107
108
/**
108
109
* Override all the rules of this set.
109
-
* @param array $aRules The rules to override with.
110
+
* @param Rule[] $aRules The rules to override with.
110
111
*/
111
112
publicfunctionsetRules(array$aRules) {
112
113
$this->aRules = array();
@@ -119,6 +120,7 @@ public function setRules(array $aRules) {
119
120
* 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.
120
121
* @param (string) $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()).
121
122
* 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 @link{getRules()} would yield an indexed array containing both.
123
+
* @return Rule[] Rules.
122
124
*/
123
125
publicfunctiongetRulesAssoc($mRule = null) {
124
126
$aResult = array();
@@ -129,9 +131,9 @@ public function getRulesAssoc($mRule = null) {
129
131
}
130
132
131
133
/**
132
-
* 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()).
133
-
* @param (null|string|Rule) $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.
134
-
*/
134
+
* 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()).
135
+
* @param (null|string|Rule) $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.
0 commit comments