You are here

class RemoveAbstractDefinitionsPass in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Compiler/RemoveAbstractDefinitionsPass.php \Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass

Removes abstract Definitions.

Hierarchy

Expanded class hierarchy of RemoveAbstractDefinitionsPass

File

vendor/symfony/dependency-injection/Compiler/RemoveAbstractDefinitionsPass.php, line 19

Namespace

Symfony\Component\DependencyInjection\Compiler
View source
class RemoveAbstractDefinitionsPass implements CompilerPassInterface {

  /**
   * Removes abstract definitions from the ContainerBuilder.
   *
   * @param ContainerBuilder $container
   */
  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'));
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RemoveAbstractDefinitionsPass::process public function Removes abstract definitions from the ContainerBuilder. Overrides CompilerPassInterface::process