We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 01edfba + 0ca45ae commit a1e23cfCopy full SHA for a1e23cf
Helper/TreeHelper.php
@@ -100,10 +100,10 @@ public function render(): void
100
$visited = new \SplObjectStorage();
101
foreach ($treeIterator as $node) {
102
$currentNode = $node instanceof TreeNode ? $node : $treeIterator->getInnerIterator()->current();
103
- if ($visited->contains($currentNode)) {
+ if (isset($visited[$currentNode])) {
104
throw new \LogicException(\sprintf('Cycle detected at node: "%s".', $currentNode->getValue()));
105
}
106
- $visited->attach($currentNode);
+ $visited[$currentNode] = true;
107
108
$this->output->writeln($node);
109
0 commit comments