Skip to content

Commit bc777e6

Browse files
committed
minor #39903 [FrameworkBundle] do not fail when MercureBundle is not installed (xabbuh)
This PR was merged into the 5.3-dev branch. Discussion ---------- [FrameworkBundle] do not fail when MercureBundle is not installed | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 8cdbdcb1c9 do not fail when MercureBundle is not installed
2 parents 08f41af + 1f84c82 commit bc777e6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,13 +2257,11 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
22572257
}
22582258
}
22592259

2260-
if (class_exists(MercureTransportFactory::class)) {
2261-
if (!class_exists(MercureBundle::class)) {
2262-
throw new \LogicException('The MercureBundle is not registered in your application. Try running "composer require symfony/mercure-bundle".');
2263-
}
2264-
2260+
if (class_exists(MercureTransportFactory::class) && class_exists(MercureBundle::class)) {
22652261
$container->getDefinition($classToServices[MercureTransportFactory::class])
22662262
->replaceArgument('$publisherLocator', new ServiceLocatorArgument(new TaggedIteratorArgument('mercure.publisher', null, null, true)));
2263+
} elseif (class_exists(MercureTransportFactory::class)) {
2264+
$container->removeDefinition($classToServices[MercureTransportFactory::class]);
22672265
}
22682266

22692267
if (isset($config['admin_recipients'])) {

0 commit comments

Comments
 (0)