/**
* Checks for circular references.
*
* @param ServiceReferenceGraphEdge[] $edges An array of Edges
*
* @throws ServiceCircularReferenceException when a circular reference is found
*/
private function checkOutEdges(array
$edges): void
{ foreach ($edges as $edge) { $node =
$edge->
getDestNode();
$id =
$node->
getId();
if (empty($this->checkedNodes
[$id])) { // Don't check circular references for lazy edges
if (!
$node->
getValue() || (!
$edge->
isLazy() && !
$edge->
isWeak())) { $searchKey =
array_search($id,
$this->currentPath
);
$this->currentPath
[] =
$id;
if (false !==
$searchKey) { throw new ServiceCircularReferenceException($id, \
array_slice($this->currentPath,
$searchKey));
}