You are here

public function ContainerBuilder::addCompilerPass in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass()

Adds a compiler pass.

@api

Parameters

CompilerPassInterface $pass A compiler pass:

string $type The type of compiler pass:

Return value

ContainerBuilder The current instance

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php, line 318

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) {
  $this
    ->getCompiler()
    ->addPass($pass, $type);
  $this
    ->addObjectResource($pass);
  return $this;
}