addPass() публичный метод

Adds a pass to the PassConfig.
public addPass ( Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface $pass, string $type = PassConfig::TYPE_BEFORE_OPTIMIZATION )
$pass Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface A compiler pass
$type string The type of the pass
Пример #1
0
 /**
  * Adds a compiler pass.
  *
  * @param CompilerPassInterface $pass A compiler pass
  * @param string                $type The type of compiler pass
  *
  * @return ContainerBuilder The current instance
  *
  * @api
  */
 public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)
 {
     if (null === $this->compiler) {
         $this->compiler = new Compiler();
     }
     $this->compiler->addPass($pass, $type);
     $this->addObjectResource($pass);
     return $this;
 }