From 7dcc6d2d7ac1299dfd14d1bc658722d7ff97f9b6 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Wed, 9 Apr 2025 22:47:07 +0100 Subject: [PATCH] [CLEANUP] Remove `CSSBlockList::allDeclarationBlocks()` Change the one remaining usage instance to use `getAllDeclarationBlocks()`, which was refactored in #990. Part of #994. --- src/CSSList/CSSBlockList.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/CSSList/CSSBlockList.php b/src/CSSList/CSSBlockList.php index bcccf9df..95148630 100644 --- a/src/CSSList/CSSBlockList.php +++ b/src/CSSList/CSSBlockList.php @@ -41,20 +41,6 @@ public function getAllDeclarationBlocks(): array return $result; } - /** - * @param list $result - */ - protected function allDeclarationBlocks(array &$result): void - { - foreach ($this->contents as $item) { - if ($item instanceof DeclarationBlock) { - $result[] = $item; - } elseif ($item instanceof CSSBlockList) { - $item->allDeclarationBlocks($result); - } - } - } - /** * Returns all `RuleSet` objects recursively found in the tree, no matter how deeply nested the rule sets are. * @@ -111,9 +97,7 @@ protected function allValues( */ protected function allSelectors(array &$result, ?string $specificitySearch = null): void { - $declarationBlocks = []; - $this->allDeclarationBlocks($declarationBlocks); - foreach ($declarationBlocks as $declarationBlock) { + foreach ($this->getAllDeclarationBlocks() as $declarationBlock) { foreach ($declarationBlock->getSelectors() as $selector) { if ($specificitySearch === null) { $result[] = $selector;