@@ -41,7 +41,7 @@ public function getAllDeclarationBlocks(): array
41
41
}
42
42
43
43
/**
44
- * @param array<int, DeclarationBlock> $result
44
+ * @param list< DeclarationBlock> $result
45
45
*/
46
46
protected function allDeclarationBlocks (array &$ result ): void
47
47
{
@@ -76,15 +76,13 @@ public function getAllRuleSets(): array
76
76
77
77
/**
78
78
* @param CSSList|Rule|RuleSet|Value $element
79
- * @param array<int, Value> $result
80
- * @param string|null $searchString
81
- * @param bool $searchInFunctionArguments
79
+ * @param list<Value> $result
82
80
*/
83
81
protected function allValues (
84
82
$ element ,
85
83
array &$ result ,
86
- $ searchString = null ,
87
- $ searchInFunctionArguments = false
84
+ ? string $ searchString = null ,
85
+ bool $ searchInFunctionArguments = false
88
86
): void {
89
87
if ($ element instanceof CSSBlockList) {
90
88
foreach ($ element ->getContents () as $ content ) {
@@ -103,18 +101,17 @@ protected function allValues(
103
101
}
104
102
}
105
103
} else {
106
- // Non-List `Value` or `CSSString` (CSS identifier)
107
- $ result [] = $ element ;
104
+ if ($ element instanceof Value) {
105
+ $ result [] = $ element ;
106
+ }
108
107
}
109
108
}
110
109
111
110
/**
112
- * @param array<int, Selector> $result
113
- * @param string|null $specificitySearch
111
+ * @param list<Selector> $result
114
112
*/
115
- protected function allSelectors (array &$ result , $ specificitySearch = null ): void
113
+ protected function allSelectors (array &$ result , ? string $ specificitySearch = null ): void
116
114
{
117
- /** @var array<int, DeclarationBlock> $declarationBlocks */
118
115
$ declarationBlocks = [];
119
116
$ this ->allDeclarationBlocks ($ declarationBlocks );
120
117
foreach ($ declarationBlocks as $ declarationBlock ) {
@@ -149,7 +146,7 @@ protected function allSelectors(array &$result, $specificitySearch = null): void
149
146
$ comparatorMatched = $ selectorSpecificity === $ targetSpecificity ;
150
147
break ;
151
148
}
152
- if ($ comparatorMatched ) {
149
+ if ($ comparatorMatched && $ selector instanceof Selector ) {
153
150
$ result [] = $ selector ;
154
151
}
155
152
}
0 commit comments