Skip to content

Commit 0c94d6e

Browse files
authored
[CLEANUP] Remove CSSBlockList::allDeclarationBlocks() (#1239)
Change the one remaining usage instance to use `getAllDeclarationBlocks()`, which was refactored in #990. Part of #994.
1 parent f036005 commit 0c94d6e

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/CSSList/CSSBlockList.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@ public function getAllDeclarationBlocks(): array
4141
return $result;
4242
}
4343

44-
/**
45-
* @param list<DeclarationBlock> $result
46-
*/
47-
protected function allDeclarationBlocks(array &$result): void
48-
{
49-
foreach ($this->contents as $item) {
50-
if ($item instanceof DeclarationBlock) {
51-
$result[] = $item;
52-
} elseif ($item instanceof CSSBlockList) {
53-
$item->allDeclarationBlocks($result);
54-
}
55-
}
56-
}
57-
5844
/**
5945
* Returns all `RuleSet` objects recursively found in the tree, no matter how deeply nested the rule sets are.
6046
*
@@ -111,9 +97,7 @@ protected function allValues(
11197
*/
11298
protected function allSelectors(array &$result, ?string $specificitySearch = null): void
11399
{
114-
$declarationBlocks = [];
115-
$this->allDeclarationBlocks($declarationBlocks);
116-
foreach ($declarationBlocks as $declarationBlock) {
100+
foreach ($this->getAllDeclarationBlocks() as $declarationBlock) {
117101
foreach ($declarationBlock->getSelectors() as $selector) {
118102
if ($specificitySearch === null) {
119103
$result[] = $selector;

0 commit comments

Comments
 (0)