Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig PHP Method

getCompilerPassConfig() public method

Returns the compiler pass config which can then be modified.
public getCompilerPassConfig ( ) : PassConfig
return Symfony\Component\DependencyInjection\Compiler\PassConfig The compiler pass config
    public function getCompilerPassConfig()
    {
        return $this->getCompiler()->getPassConfig();
    }

Usage Example

 protected function getContainer()
 {
     $container = new ContainerBuilder();
     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config'));
     $loader->load('monolog.xml');
     $definition = $container->getDefinition('monolog.logger_prototype');
     $container->set('monolog.handler.test', new Definition('%monolog.handler.null.class%', array(100, false)));
     $definition->addMethodCall('pushHandler', array(new Reference('monolog.handler.test')));
     // Handlers
     $container->set('monolog.handler.a', new Definition('%monolog.handler.null.class%', array(100, false)));
     $container->set('monolog.handler.b', new Definition('%monolog.handler.null.class%', array(100, false)));
     $container->set('monolog.handler.c', new Definition('%monolog.handler.null.class%', array(100, false)));
     // Channels
     foreach (array('test', 'foo', 'bar') as $name) {
         $service = new Definition('TestClass', array('false', new Reference('logger')));
         $service->addTag('monolog.logger', array('channel' => $name));
         $container->setDefinition($name, $service);
     }
     $container->setParameter('monolog.handlers_to_channels', array('monolog.handler.a' => array('type' => 'inclusive', 'elements' => array('test')), 'monolog.handler.b' => null, 'monolog.handler.c' => array('type' => 'exclusive', 'elements' => array('foo'))));
     $container->getCompilerPassConfig()->setOptimizationPasses(array());
     $container->getCompilerPassConfig()->setRemovingPasses(array());
     $container->addCompilerPass(new LoggerChannelPass());
     $container->compile();
     return $container;
 }
All Usage Examples Of Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig