File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,13 @@ abstract class CSSBlockList extends CSSList
27
27
*/
28
28
public function getAllDeclarationBlocks (): array
29
29
{
30
- /** @var list<DeclarationBlock> $result */
31
30
$ result = [];
32
31
33
- foreach ($ this ->contents as $ directSibling ) {
34
- if ($ directSibling instanceof DeclarationBlock) {
35
- $ result [] = $ directSibling ;
36
- } elseif ($ directSibling instanceof CSSBlockList) {
37
- foreach ($ directSibling ->getAllDeclarationBlocks () as $ grandchild ) {
38
- $ result [] = $ grandchild ;
39
- }
32
+ foreach ($ this ->contents as $ item ) {
33
+ if ($ item instanceof DeclarationBlock) {
34
+ $ result [] = $ item ;
35
+ } elseif ($ item instanceof CSSBlockList) {
36
+ $ result = \array_merge ($ result , $ item ->getAllDeclarationBlocks ());
40
37
}
41
38
}
42
39
You can’t perform that action at this time.
0 commit comments