Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PhpDumper.php

function PhpDumper::analyzeReferences

1 call to PhpDumper::analyzeReferences()
PhpDumper::dump in vendor/symfony/dependency-injection/Dumper/PhpDumper.php
Dumps the service container as a PHP class.

File

vendor/symfony/dependency-injection/Dumper/PhpDumper.php, line 417

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function analyzeReferences() : void {
    (new AnalyzeServiceReferencesPass(false, $this->hasProxyDumper))
        ->process($this->container);
    $checkedNodes = [];
    $this->circularReferences = [];
    $this->singleUsePrivateIds = [];
    foreach ($this->container
        ->getCompiler()
        ->getServiceReferenceGraph()
        ->getNodes() as $id => $node) {
        if (!$node->getValue() instanceof Definition) {
            continue;
        }
        if ($this->isSingleUsePrivateNode($node)) {
            $this->singleUsePrivateIds[$id] = $id;
        }
        $this->collectCircularReferences($id, $node->getOutEdges(), $checkedNodes);
    }
    $this->container
        ->getCompiler()
        ->getServiceReferenceGraph()
        ->clear();
    $this->singleUsePrivateIds = array_diff_key($this->singleUsePrivateIds, $this->circularReferences);
}
RSS feed
Powered by Drupal