Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions src/CSSList/CSSBlockList.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@ public function getAllDeclarationBlocks(): array
return $result;
}

/**
* @param list<DeclarationBlock> $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.
*
Expand Down Expand Up @@ -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;
Expand Down