File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
6
6
use Symfony \Component \DependencyInjection \ContainerBuilder ;
7
+ use Symfony \Component \DependencyInjection \ContainerInterface ;
7
8
use Symfony \Component \DependencyInjection \Reference ;
8
9
9
10
/**
@@ -23,14 +24,15 @@ public function process(ContainerBuilder $container)
23
24
if (!$ container ->has (self ::EVENT_DISPATCHER_SERVICE_ID )) {
24
25
return ;
25
26
}
26
- $ eventDispatcherDefinition = $ container ->findDefinition (self ::EVENT_DISPATCHER_SERVICE_ID );
27
27
$ taggedConsumers = $ container ->findTaggedServiceIds ('old_sound_rabbit_mq.base_amqp ' );
28
28
29
29
foreach ($ taggedConsumers as $ id => $ tag ) {
30
30
$ definition = $ container ->getDefinition ($ id );
31
31
$ definition ->addMethodCall (
32
32
'setEventDispatcher ' ,
33
- [$ eventDispatcherDefinition ]
33
+ [
34
+ new Reference (self ::EVENT_DISPATCHER_SERVICE_ID , ContainerInterface::IGNORE_ON_INVALID_REFERENCE )
35
+ ]
34
36
);
35
37
}
36
38
You can’t perform that action at this time.
0 commit comments