@@ -150,7 +150,7 @@ protected function loadProducers()
150150 $ definition ->addMethodCall ('disableAutoSetupFabric ' );
151151 }
152152
153- if ($ producer ['audit ' ]) {
153+ if ($ producer ['enable_logger ' ]) {
154154 $ this ->injectLogger ($ definition );
155155 }
156156
@@ -183,7 +183,7 @@ protected function loadConsumers()
183183 ));
184184 }
185185
186- if (isset ($ consumer ['idle_timeout ' ])) {
186+ if (isset ($ consumer ['idle_timeout ' ])) {
187187 $ definition ->addMethodCall ('setIdleTimeout ' , array ($ consumer ['idle_timeout ' ]));
188188 }
189189 if (!$ consumer ['auto_setup_fabric ' ]) {
@@ -195,7 +195,7 @@ protected function loadConsumers()
195195 $ this ->injectLoggedChannel ($ definition , $ key , $ consumer ['connection ' ]);
196196 }
197197
198- if ($ consumer ['audit ' ]) {
198+ if ($ consumer ['enable_logger ' ]) {
199199 $ this ->injectLogger ($ definition );
200200 }
201201
@@ -219,7 +219,7 @@ protected function loadMultipleConsumers()
219219 }
220220
221221 foreach ($ consumer ['queues ' ] as $ queueName => $ queueOptions ) {
222- $ queues [$ queueOptions ['name ' ]] = $ queueOptions ;
222+ $ queues [$ queueOptions ['name ' ]] = $ queueOptions ;
223223 $ queues [$ queueOptions ['name ' ]]['callback ' ] = array (new Reference ($ queueOptions ['callback ' ]), 'execute ' );
224224 $ callbacks [] = new Reference ($ queueOptions ['callback ' ]);
225225 }
@@ -246,7 +246,7 @@ protected function loadMultipleConsumers()
246246 ));
247247 }
248248
249- if (isset ($ consumer ['idle_timeout ' ])) {
249+ if (isset ($ consumer ['idle_timeout ' ])) {
250250 $ definition ->addMethodCall ('setIdleTimeout ' , array ($ consumer ['idle_timeout ' ]));
251251 }
252252 if (!$ consumer ['auto_setup_fabric ' ]) {
@@ -258,7 +258,7 @@ protected function loadMultipleConsumers()
258258 $ this ->injectLoggedChannel ($ definition , $ key , $ consumer ['connection ' ]);
259259 }
260260
261- if ($ consumer ['audit ' ]) {
261+ if ($ consumer ['enable_logger ' ]) {
262262 $ this ->injectLogger ($ definition );
263263 }
264264
@@ -272,18 +272,18 @@ protected function loadMultipleConsumers()
272272 }
273273 }
274274 }
275-
275+
276276 protected function loadDynamicConsumers ()
277- {
277+ {
278278 foreach ($ this ->config ['dynamic_consumers ' ] as $ key => $ consumer ) {
279-
279+
280280 if (empty ($ consumer ['queue_options_provider ' ])) {
281281 throw new InvalidConfigurationException (
282282 "Error on loading $ key dynamic consumer. " .
283283 "'queue_provider' parameter should be defined. "
284284 );
285285 }
286-
286+
287287 $ definition = new Definition ('%old_sound_rabbit_mq.dynamic_consumer.class% ' );
288288 $ definition
289289 ->addTag ('old_sound_rabbit_mq.base_amqp ' )
@@ -299,13 +299,13 @@ protected function loadDynamicConsumers()
299299 $ consumer ['qos_options ' ]['global ' ]
300300 ));
301301 }
302-
302+
303303 $ definition ->addMethodCall (
304- 'setQueueOptionsProvider ' ,
305- array (new Reference ($ consumer ['queue_options_provider ' ]))
306- );
307-
308- if (isset ($ consumer ['idle_timeout ' ])) {
304+ 'setQueueOptionsProvider ' ,
305+ array (new Reference ($ consumer ['queue_options_provider ' ]))
306+ );
307+
308+ if (isset ($ consumer ['idle_timeout ' ])) {
309309 $ definition ->addMethodCall ('setIdleTimeout ' , array ($ consumer ['idle_timeout ' ]));
310310 }
311311 if (!$ consumer ['auto_setup_fabric ' ]) {
@@ -317,7 +317,7 @@ protected function loadDynamicConsumers()
317317 $ this ->injectLoggedChannel ($ definition , $ key , $ consumer ['connection ' ]);
318318 }
319319
320- if ($ consumer ['audit ' ]) {
320+ if ($ consumer ['enable_logger ' ]) {
321321 $ this ->injectLogger ($ definition );
322322 }
323323
@@ -456,7 +456,7 @@ protected function loadRpcServers()
456456
457457 protected function injectLoggedChannel (Definition $ definition , $ name , $ connectionName )
458458 {
459- $ id = sprintf ('old_sound_rabbit_mq.channel.%s ' , $ name );
459+ $ id = sprintf ('old_sound_rabbit_mq.channel.%s ' , $ name );
460460 $ channel = new Definition ('%old_sound_rabbit_mq.logged.channel.class% ' );
461461 $ channel
462462 ->setPublic (false )
@@ -487,12 +487,12 @@ public function getAlias()
487487 */
488488 protected function addDequeuerAwareCall ($ callback , $ name )
489489 {
490- if (! $ this ->container ->has ($ callback )) {
490+ if (!$ this ->container ->has ($ callback )) {
491491 return ;
492492 }
493493
494494 $ callbackDefinition = $ this ->container ->findDefinition ($ callback );
495- $ refClass = new \ReflectionClass ($ callbackDefinition ->getClass ());
495+ $ refClass = new \ReflectionClass ($ callbackDefinition ->getClass ());
496496 if ($ refClass ->implementsInterface ('OldSound\RabbitMqBundle\RabbitMq\DequeuerAwareInterface ' )) {
497497 $ callbackDefinition ->addMethodCall ('setDequeuer ' , array (new Reference ($ name )));
498498 }
@@ -503,5 +503,8 @@ private function injectLogger(Definition $definition)
503503 $ definition ->addTag ('monolog.logger ' , array (
504504 'channel ' => 'phpamqplib '
505505 ));
506+ if ($ this ->container ->has ('logger ' )) {
507+ $ definition ->addMethodCall ('setLogger ' , array (new Reference ('logger ' )));
508+ }
506509 }
507510}
0 commit comments