Skip to content

Commit 9ede776

Browse files
committed
Update DetectWalker.php
1 parent fb00892 commit 9ede776

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/Parser/DetectWalker.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ protected function handleContext(Node $node, AbstractContext $context)
5757
foreach ($nodesToDetect as $nodeClass) {
5858
if ($node instanceof $nodeClass) {
5959
$this->items[] = $context;
60+
61+
$context->parent->children = array_filter($context->parent->children, fn($child) => $child !== $context);
6062
}
6163
}
6264

0 commit comments

Comments
 (0)