@@ -242,6 +242,13 @@ public function load(array $configs, ContainerBuilder $container)
242242 $ this ->registerTemplatingConfiguration ($ config ['templating ' ], $ container , $ loader );
243243 }
244244
245+ if ($ this ->messengerConfigEnabled = $ this ->isConfigEnabled ($ container , $ config ['messenger ' ])) {
246+ $ this ->registerMessengerConfiguration ($ config ['messenger ' ], $ container , $ loader , $ config ['serializer ' ], $ config ['validation ' ]);
247+ } else {
248+ $ container ->removeDefinition ('console.command.messenger_consume_messages ' );
249+ $ container ->removeDefinition ('console.command.messenger_debug ' );
250+ }
251+
245252 $ this ->registerValidationConfiguration ($ config ['validation ' ], $ container , $ loader );
246253 $ this ->registerEsiConfiguration ($ config ['esi ' ], $ container , $ loader );
247254 $ this ->registerSsiConfiguration ($ config ['ssi ' ], $ container , $ loader );
@@ -271,13 +278,6 @@ public function load(array $configs, ContainerBuilder $container)
271278 $ this ->registerLockConfiguration ($ config ['lock ' ], $ container , $ loader );
272279 }
273280
274- if ($ this ->messengerConfigEnabled = $ this ->isConfigEnabled ($ container , $ config ['messenger ' ])) {
275- $ this ->registerMessengerConfiguration ($ config ['messenger ' ], $ container , $ loader , $ config ['serializer ' ], $ config ['validation ' ]);
276- } else {
277- $ container ->removeDefinition ('console.command.messenger_consume_messages ' );
278- $ container ->removeDefinition ('console.command.messenger_debug ' );
279- }
280-
281281 if ($ this ->isConfigEnabled ($ container , $ config ['web_link ' ])) {
282282 if (!class_exists (HttpHeaderSerializer::class)) {
283283 throw new LogicException ('WebLink support cannot be enabled as the WebLink component is not installed. ' );
0 commit comments