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;