10000 do not fail when MercureBundle is not installed · alex-dev/symfony@8cdbdcb · GitHub
[go: up one dir, main page]

Skip to content

Commit 8cdbdcb

Browse files
committed
do not fail when MercureBundle is not installed
1 parent 4818b28 commit 8cdbdcb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/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)
0