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\CompilerCode
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 = [];
}
}