* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Adds tagged zend.logger.writer services to zend.logger service * * @author Fabien Potencier */ class ZendLoggerWriterPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { if (false === $container->hasDefinition('zend.logger')) { return; } $definition = $container->getDefinition('zend.logger'); foreach ($container->findTaggedServiceIds('zend.logger.writer') as $id => $attributes) { $definition->addMethodCall('addWriter', array(new Reference($id))); } } }