Skip to content

Commit c0800de

Browse files
committed
Add phpdoc return tags
1 parent 048af5b commit c0800de

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public function setSelector($mSelector) {
7676
$this->setSelectors($mSelector);
7777
}
7878

79+
/**
80+
* Get selectors.
81+
*
82+
* @return Selector[] Selectors.
83+
*/
7984
public function getSelectors() {
8085
return $this->aSelectors;
8186
}

lib/Sabberworm/CSS/RuleSet/RuleSet.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function addRule(Rule $oRule, Rule $oSibling = null) {
8989
* @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()).
9090
* @example $oRuleSet->getRules('font-') //returns an array of all rules either beginning with font- or matching font.
9191
* @example $oRuleSet->getRules('font') //returns array(0 => $oRule, …) or array().
92+
* @return Rule[] Rules.
9293
*/
9394
public function getRules($mRule = null) {
9495
if ($mRule instanceof Rule) {
@@ -119,6 +120,7 @@ public function setRules(array $aRules) {
119120
* 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.
120121
* @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()).
121122
* 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 array Rules.
122124
*/
123125
public function getRulesAssoc($mRule = null) {
124126
$aResult = array();
@@ -129,9 +131,9 @@ public function getRulesAssoc($mRule = null) {
129131
}
130132

131133
/**
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.
136+
*/
135137
public function removeRule($mRule) {
136138
if($mRule instanceof Rule) {
137139
$sRule = $mRule->getRule();

0 commit comments

Comments
 (0)