Skip to content

Commit 6f1056b

Browse files
committed
logger is not yet present. Don't check for it's existance, but ignore if missing
1 parent 737da78 commit 6f1056b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

DependencyInjection/OldSoundRabbitMqExtension.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace OldSound\RabbitMqBundle\DependencyInjection;
44

55
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
6+
use Symfony\Component\DependencyInjection\ContainerInterface;
67
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
78
use Symfony\Component\DependencyInjection\Extension\Extension;
89
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -511,9 +512,7 @@ private function injectLogger(Definition $definition)
511512
$definition->addTag('monolog.logger', array(
512513
'channel' => 'phpamqplib'
513514
));
514-
if ($this->container->has('logger')) {
515-
$definition->addMethodCall('setLogger', array(new Reference('logger')));
516-
}
515+
$definition->addMethodCall('setLogger', array(new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)));
517516
}
518517

519518
/**

0 commit comments

Comments
 (0)