addPass() 공개 메소드

Adds a pass.
public addPass ( Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface $pass, string $type = self::TYPE_BEFORE_OPTIMIZATION )
$pass Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface A Compiler pass
$type string The pass type
예제 #1
0
 /**
  * @param PassConfig $passConfig
  */
 public function configureContainerPass(PassConfig $passConfig)
 {
     $passConfig->addPass(new RegisterInputPass());
     $passConfig->addPass(new RegisterOutputPass());
     $passConfig->addPass(new RegisterApplicationPass());
     $passConfig->addPass(new RegisterCommandsPass());
 }
예제 #2
0
 public function testPassOrdering()
 {
     $config = new PassConfig();
     $pass1 = $this->getMock(CompilerPassInterface::class);
     $config->addPass($pass1, PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
     $pass2 = $this->getMock(CompilerPassInterface::class);
     $config->addPass($pass2, PassConfig::TYPE_BEFORE_OPTIMIZATION, 30);
     $this->assertSame(array($pass2, $pass1), $config->getBeforeOptimizationPasses());
 }