/**
* Checks the ContainerBuilder object for circular references.
- *
- * @param ContainerBuilder $container The ContainerBuilder instances
*/
public function process(ContainerBuilder $container)
{
*
* @param ServiceReferenceGraphEdge[] $edges An array of Edges
*
- * @throws ServiceCircularReferenceException When a circular reference is found.
+ * @throws ServiceCircularReferenceException when a circular reference is found
*/
private function checkOutEdges(array $edges)
{
$id = $node->getId();
if (empty($this->checkedNodes[$id])) {
- // don't check circular dependencies for lazy services
- if (!$node->getValue() || !$node->getValue()->isLazy()) {
+ // Don't check circular references for lazy edges
+ if (!$node->getValue() || (!$edge->isLazy() && !$edge->isWeak())) {
$searchKey = array_search($id, $this->currentPath);
$this->currentPath[] = $id;