Skip to content

Commit 6ab9710

Browse files
committed
Drop support of mercure:^0.4
1 parent 597311d commit 6ab9710

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
2727
use Symfony\Bundle\FrameworkBundle\Routing\RouteLoaderInterface;
2828
use Symfony\Bundle\FullStack;
29+
use Symfony\Bundle\MercureBundle\MercureBundle;
2930
use Symfony\Component\Asset\PackageInterface;
3031
use Symfony\Component\BrowserKit\AbstractBrowser;
3132
use Symfony\Component\Cache\Adapter\AdapterInterface;
@@ -44,8 +45,6 @@
4445
use Symfony\Component\Console\Command\Command;
4546
use Symfony\Component\DependencyInjection\Alias;
4647
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
47-
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
48-
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
4948
use Symfony\Component\DependencyInjection\ChildDefinition;
5049
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
5150
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -2369,17 +2368,11 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
23692368
}
23702369
}
23712370

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]);
23832376
}
23842377

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

0 commit comments

Comments
 (0)