|
26 | 26 | use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
|
27 | 27 | use Symfony\Bundle\FrameworkBundle\Routing\RouteLoaderInterface;
|
28 | 28 | use Symfony\Bundle\FullStack;
|
| 29 | +use Symfony\Bundle\MercureBundle\MercureBundle; |
29 | 30 | use Symfony\Component\Asset\PackageInterface;
|
30 | 31 | use Symfony\Component\BrowserKit\AbstractBrowser;
|
31 | 32 | use Symfony\Component\Cache\Adapter\AdapterInterface;
|
|
44 | 45 | use Symfony\Component\Console\Command\Command;
|
45 | 46 | use Symfony\Component\DependencyInjection\Alias;
|
46 | 47 | use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
|
47 |
| -use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; |
48 |
| -use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; |
49 | 48 | use Symfony\Component\DependencyInjection\ChildDefinition;
|
50 | 49 | use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
|
51 | 50 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
@@ -2369,17 +2368,11 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
|
2369 | 2368 | }
|
2370 | 2369 | }
|
2371 | 2370 |
|
2372 |
| - if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages)) { |
2373 |
| - if (ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class, $parentPackages)) { |
2374 |
| - $definition = $container->getDefinition($classToServices[MercureTransportFactory::class]); |
2375 |
| - if (ContainerBuilder::willBeAvailable('symfony/mercure', HubRegistry::class, $parentPackages)) { |
2376 |
| - $definition->replaceArgument('$registry', new Reference(HubRegistry::class)); |
2377 |
| - } else { |
2378 |
| - $definition->replaceArgument('$registry', new ServiceLocatorArgument(new TaggedIteratorArgument('mercure.publisher', null, null, true))); |
2379 |
| - } |
2380 |
| - } else { |
2381 |
| - $container->removeDefinition($classToServices[MercureTransportFactory::class]); |
2382 |
| - } |
| 2371 | + if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages) && ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class, $parentPackages)) { |
| 2372 | + $container->getDefinition($classToServices[MercureTransportFactory::class]) |
| 2373 | + ->replaceArgument('$registry', new Reference(HubRegistry::class)); |
| 2374 | + } elseif (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages)) { |
| 2375 | + $container->removeDefinition($classToServices[MercureTransportFactory::class]); |
2383 | 2376 | }
|
2384 | 2377 |
|
2385 | 2378 | if (isset($config['admin_recipients'])) {
|
|
0 commit comments