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

Breadcrumb

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

function AnalyzeServiceReferencesPass::process

Processes a ContainerBuilder object to populate the service reference graph.

Overrides AbstractRecursivePass::process

File

vendor/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php, line 58

Class

AnalyzeServiceReferencesPass
Run this pass before passes that need to know more about the relation of your services.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) : void {
    $this->container = $container;
    $this->graph = $container->getCompiler()
        ->getServiceReferenceGraph();
    $this->graph
        ->clear();
    $this->lazy = false;
    $this->byConstructor = false;
    $this->byFactory = false;
    $this->definitions = $container->getDefinitions();
    $this->aliases = $container->getAliases();
    foreach ($this->aliases as $id => $alias) {
        $targetId = $this->getDefinitionId((string) $alias);
        $this->graph
            ->connect($id, $alias, $targetId, null !== $targetId ? $this->container
            ->getDefinition($targetId) : null, null);
    }
    try {
        parent::process($container);
    } finally {
        $this->aliases = $this->definitions = [];
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal