1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
This commit is contained in:
Daniil Gentili 2024-01-17 13:32:15 +01:00
parent 4e5e30633b
commit 823c9180fd

View File

@ -29,7 +29,7 @@ final class CustomTraverser extends NodeTraverser
* @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 @@ final class CustomTraverser extends NodeTraverser
}
if ($traverseChildren) {
$this->traverseNode($subNode);
$subNode = $this->traverseNode($subNode);
if ($this->stopTraversal) {
break;
}
@ -88,6 +88,8 @@ final class CustomTraverser extends NodeTraverser
}
}
}
return $node;
}
/**