21
21
abstract class CSSBlockList extends CSSList
22
22
{
23
23
/**
24
- * @param int $iLineNo
24
+ * @param int $lineNumber
25
25
*/
26
- public function __construct ($ iLineNo = 0 )
26
+ public function __construct ($ lineNumber = 0 )
27
27
{
28
- parent ::__construct ($ iLineNo );
28
+ parent ::__construct ($ lineNumber );
29
29
}
30
30
31
31
/**
32
- * @param array<int, DeclarationBlock> $aResult
32
+ * @param array<int, DeclarationBlock> $result
33
33
*/
34
- protected function allDeclarationBlocks (array &$ aResult ): void
34
+ protected function allDeclarationBlocks (array &$ result ): void
35
35
{
36
36
foreach ($ this ->aContents as $ mContent ) {
37
37
if ($ mContent instanceof DeclarationBlock) {
38
- $ aResult [] = $ mContent ;
38
+ $ result [] = $ mContent ;
39
39
} elseif ($ mContent instanceof CSSBlockList) {
40
- $ mContent ->allDeclarationBlocks ($ aResult );
40
+ $ mContent ->allDeclarationBlocks ($ result );
41
41
}
42
42
}
43
43
}
44
44
45
45
/**
46
- * @param array<int, RuleSet> $aResult
46
+ * @param array<int, RuleSet> $result
47
47
*/
48
- protected function allRuleSets (array &$ aResult ): void
48
+ protected function allRuleSets (array &$ result ): void
49
49
{
50
50
foreach ($ this ->aContents as $ mContent ) {
51
51
if ($ mContent instanceof RuleSet) {
52
- $ aResult [] = $ mContent ;
52
+ $ result [] = $ mContent ;
53
53
} elseif ($ mContent instanceof CSSBlockList) {
54
- $ mContent ->allRuleSets ($ aResult );
54
+ $ mContent ->allRuleSets ($ result );
55
55
}
56
56
}
57
57
}
58
58
59
59
/**
60
- * @param CSSList|Rule|RuleSet|Value $oElement
61
- * @param array<int, Value> $aResult
62
- * @param string|null $sSearchString
63
- * @param bool $bSearchInFunctionArguments
60
+ * @param CSSList|Rule|RuleSet|Value $element
61
+ * @param array<int, Value> $result
62
+ * @param string|null $searchString
63
+ * @param bool $searchInFunctionArguments
64
64
*/
65
65
protected function allValues (
66
- $ oElement ,
67
- array &$ aResult ,
68
- $ sSearchString = null ,
69
- $ bSearchInFunctionArguments = false
66
+ $ element ,
67
+ array &$ result ,
68
+ $ searchString = null ,
69
+ $ searchInFunctionArguments = false
70
70
): void {
71
- if ($ oElement instanceof CSSBlockList) {
72
- foreach ($ oElement ->getContents () as $ oContent ) {
73
- $ this ->allValues ($ oContent , $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
71
+ if ($ element instanceof CSSBlockList) {
72
+ foreach ($ element ->getContents () as $ oContent ) {
73
+ $ this ->allValues ($ oContent , $ result , $ searchString , $ searchInFunctionArguments );
74
74
}
75
- } elseif ($ oElement instanceof RuleSet) {
76
- foreach ($ oElement ->getRules ($ sSearchString ) as $ oRule ) {
77
- $ this ->allValues ($ oRule , $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
75
+ } elseif ($ element instanceof RuleSet) {
76
+ foreach ($ element ->getRules ($ searchString ) as $ oRule ) {
77
+ $ this ->allValues ($ oRule , $ result , $ searchString , $ searchInFunctionArguments );
78
78
}
79
- } elseif ($ oElement instanceof Rule) {
80
- $ this ->allValues ($ oElement ->getValue (), $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
81
- } elseif ($ oElement instanceof ValueList) {
82
- if ($ bSearchInFunctionArguments || !($ oElement instanceof CSSFunction)) {
83
- foreach ($ oElement ->getListComponents () as $ mComponent ) {
84
- $ this ->allValues ($ mComponent , $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
79
+ } elseif ($ element instanceof Rule) {
80
+ $ this ->allValues ($ element ->getValue (), $ result , $ searchString , $ searchInFunctionArguments );
81
+ } elseif ($ element instanceof ValueList) {
82
+ if ($ searchInFunctionArguments || !($ element instanceof CSSFunction)) {
83
+ foreach ($ element ->getListComponents () as $ mComponent ) {
84
+ $ this ->allValues ($ mComponent , $ result , $ searchString , $ searchInFunctionArguments );
85
85
}
86
86
}
87
87
} else {
88
88
// Non-List `Value` or `CSSString` (CSS identifier)
89
- $ aResult [] = $ oElement ;
89
+ $ result [] = $ element ;
90
90
}
91
91
}
92
92
93
93
/**
94
- * @param array<int, Selector> $aResult
95
- * @param string|null $sSpecificitySearch
94
+ * @param array<int, Selector> $result
95
+ * @param string|null $specificitySearch
96
96
*/
97
- protected function allSelectors (array &$ aResult , $ sSpecificitySearch = null ): void
97
+ protected function allSelectors (array &$ result , $ specificitySearch = null ): void
98
98
{
99
99
/** @var array<int, DeclarationBlock> $aDeclarationBlocks */
100
100
$ aDeclarationBlocks = [];
101
101
$ this ->allDeclarationBlocks ($ aDeclarationBlocks );
102
102
foreach ($ aDeclarationBlocks as $ oBlock ) {
103
103
foreach ($ oBlock ->getSelectors () as $ oSelector ) {
104
- if ($ sSpecificitySearch === null ) {
105
- $ aResult [] = $ oSelector ;
104
+ if ($ specificitySearch === null ) {
105
+ $ result [] = $ oSelector ;
106
106
} else {
107
107
$ sComparator = '=== ' ;
108
- $ aSpecificitySearch = \explode (' ' , $ sSpecificitySearch );
108
+ $ aSpecificitySearch = \explode (' ' , $ specificitySearch );
109
109
$ iTargetSpecificity = $ aSpecificitySearch [0 ];
110
110
if (\count ($ aSpecificitySearch ) > 1 ) {
111
111
$ sComparator = $ aSpecificitySearch [0 ];
@@ -132,7 +132,7 @@ protected function allSelectors(array &$aResult, $sSpecificitySearch = null): vo
132
132
break ;
133
133
}
134
134
if ($ bMatches ) {
135
- $ aResult [] = $ oSelector ;
135
+ $ result [] = $ oSelector ;
136
136
}
137
137
}
138
138
}
0 commit comments