Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bd29c4

Browse files
committed
Do not pass anything if the message_bus service do not exists
1 parent dd0d640 commit 3bd29c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Message/DependencyInjection/MessagePass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public function __construct(string $messageBusService = 'message_bus', string $m
4242
*/
4343
public function process(ContainerBuilder $container)
4444
{
45+
if (!$container->hasDefinition($this->messageBusService)) {
46+
return;
47+
}
48+
4549
if (!$middlewares = $this->findAndSortTaggedServices($this->middlewareTag, $container)) {
4650
throw new RuntimeException(sprintf('You must tag at least one service as "%s" to use the "%s" service.', $this->middlewareTag, $this->messageBusService));
4751
}

0 commit comments

Comments
 (0)