Checks for circular references.
array $edges An array of Nodes:
ServiceCircularReferenceException When a circular reference is found.
private function checkOutEdges(array $edges) {
foreach ($edges as $edge) {
$node = $edge
->getDestNode();
$this->currentPath[] = $id = $node
->getId();
if ($this->currentId === $id) {
throw new ServiceCircularReferenceException($this->currentId, $this->currentPath);
}
$this
->checkOutEdges($node
->getOutEdges());
array_pop($this->currentPath);
}
}