You are here

public function ResolveDefinitionTemplatesPass::process in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php \Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass::process()

Process the ContainerBuilder to replace DefinitionDecorator instances with their real Definition instances.

Parameters

ContainerBuilder $container:

Overrides CompilerPassInterface::process

File

vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php, line 36

Class

ResolveDefinitionTemplatesPass
This replaces all DefinitionDecorator instances with their equivalent fully merged Definition instance.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) {
  $this->container = $container;
  $this->compiler = $container
    ->getCompiler();
  $this->formatter = $this->compiler
    ->getLoggingFormatter();
  foreach ($container
    ->getDefinitions() as $id => $definition) {

    // yes, we are specifically fetching the definition from the
    // container to ensure we are not operating on stale data
    $definition = $container
      ->getDefinition($id);
    if (!$definition instanceof DefinitionDecorator || $definition
      ->isAbstract()) {
      continue;
    }
    $this
      ->resolveDefinition($id, $definition);
  }
}