Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jul 3, 2024
1 parent 9893a40 commit 957854c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Psalm/Internal/PhpTraverser/CustomTraverser.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public function __construct()
* Recursively traverse a node.
*
* @param Node $node node to traverse
* @return Node Result of traversal (may be original node or new one)
*/
protected function traverseNode(Node $node): Node
protected function traverseNode(Node $node): void
{
foreach ($node->getSubNodeNames() as $name) {
$subNode = &$node->$name;
Expand Down Expand Up @@ -60,7 +59,7 @@ protected function traverseNode(Node $node): Node
}

if ($traverseChildren) {
$subNode = $this->traverseNode($subNode);
$this->traverseNode($subNode);
if ($this->stopTraversal) {
break;
}
Expand Down Expand Up @@ -88,8 +87,6 @@ protected function traverseNode(Node $node): Node
}
}
}

return $node;
}

/**
Expand Down Expand Up @@ -124,7 +121,7 @@ protected function traverseArray(array $nodes): array
}

if ($traverseChildren) {
$node = $this->traverseNode($node);
$this->traverseNode($node);
if ($this->stopTraversal) {
break;
}
Expand Down

0 comments on commit 957854c

Please sign in to comment.