From 823c9180fd801bf8bee948afb57a8b9673f38af0 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 17 Jan 2024 13:32:15 +0100 Subject: [PATCH] Fixup --- src/Psalm/Internal/PhpTraverser/CustomTraverser.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/PhpTraverser/CustomTraverser.php b/src/Psalm/Internal/PhpTraverser/CustomTraverser.php index 397601d4e59..f1e2673572d 100644 --- a/src/Psalm/Internal/PhpTraverser/CustomTraverser.php +++ b/src/Psalm/Internal/PhpTraverser/CustomTraverser.php @@ -29,7 +29,7 @@ public function __construct() * @param Node $node node to traverse * @return Node Result of traversal (may be original node or new one) */ - protected function traverseNode(Node $node): void + protected function traverseNode(Node $node): Node { foreach ($node->getSubNodeNames() as $name) { $subNode = &$node->$name; @@ -60,7 +60,7 @@ protected function traverseNode(Node $node): void } if ($traverseChildren) { - $this->traverseNode($subNode); + $subNode = $this->traverseNode($subNode); if ($this->stopTraversal) { break; } @@ -88,6 +88,8 @@ protected function traverseNode(Node $node): void } } } + + return $node; } /**