private function CheckCircularReferencesPass::checkOutEdges

Checks for circular references.

Parameters

array $edges An array of Nodes:

Throws

ServiceCircularReferenceException When a circular reference is found.

1 call to CheckCircularReferencesPass::checkOutEdges()
CheckCircularReferencesPass::process in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php
Checks the ContainerBuilder object for circular references.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php, line 56

Class

CheckCircularReferencesPass
Checks your services for circular references

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

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);
  }
}