You are here

public function RemoveAbstractDefinitionsPass::process in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php \Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass::process()

Removes abstract definitions from the ContainerBuilder.

Parameters

ContainerBuilder $container:

Overrides CompilerPassInterface::process

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php, line 26

Class

RemoveAbstractDefinitionsPass
Removes abstract Definitions.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) {
  $compiler = $container
    ->getCompiler();
  $formatter = $compiler
    ->getLoggingFormatter();
  foreach ($container
    ->getDefinitions() as $id => $definition) {
    if ($definition
      ->isAbstract()) {
      $container
        ->removeDefinition($id);
      $compiler
        ->addLogMessage($formatter
        ->formatRemoveService($this, $id, 'abstract'));
    }
  }
}