You are here

public function InlineServiceDefinitionsPass::process in Zircon Profile 8

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

Processes the ContainerBuilder for inline service definitions.

Parameters

ContainerBuilder $container:

Overrides CompilerPassInterface::process

File

vendor/symfony/dependency-injection/Compiler/InlineServiceDefinitionsPass.php, line 45

Class

InlineServiceDefinitionsPass
Inline service definitions where this is possible.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) {
  $this->compiler = $container
    ->getCompiler();
  $this->formatter = $this->compiler
    ->getLoggingFormatter();
  $this->graph = $this->compiler
    ->getServiceReferenceGraph();
  foreach ($container
    ->getDefinitions() as $id => $definition) {
    $this->currentId = $id;
    $definition
      ->setArguments($this
      ->inlineArguments($container, $definition
      ->getArguments()));
    $definition
      ->setMethodCalls($this
      ->inlineArguments($container, $definition
      ->getMethodCalls()));
    $definition
      ->setProperties($this
      ->inlineArguments($container, $definition
      ->getProperties()));
    $configurator = $this
      ->inlineArguments($container, array(
      $definition
        ->getConfigurator(),
    ));
    $definition
      ->setConfigurator($configurator[0]);
    $factory = $this
      ->inlineArguments($container, array(
      $definition
        ->getFactory(),
    ));
    $definition
      ->setFactory($factory[0]);
  }
}