File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1616use Symfony \Bundle \MercureBundle \DataCollector \MercureDataCollector ;
1717use Symfony \Component \Config \Definition \ConfigurationInterface ;
1818use Symfony \Component \DependencyInjection \Argument \IteratorArgument ;
19+ use Symfony \Component \DependencyInjection \Compiler \AliasDeprecatedPublicServicesPass ;
1920use Symfony \Component \DependencyInjection \ContainerBuilder ;
2021use Symfony \Component \DependencyInjection \ContainerInterface ;
2122use Symfony \Component \DependencyInjection \Reference ;
@@ -95,7 +96,13 @@ public function load(array $configs, ContainerBuilder $container)
9596 }
9697
9798 $ alias = $ container ->setAlias (Publisher::class, $ defaultHub );
98- $ alias ->setDeprecated (true , 'The "%alias_id%" service alias is deprecated. Use " ' .PublisherInterface::class.'" instead. ' );
99+
100+ // Use the 5.1 signature for Alias::setDeprecated()
101+ if (class_exists (AliasDeprecatedPublicServicesPass::class)) {
102+ $ alias ->setDeprecated ('symfony/mercure-bundle ' , '0.2 ' , 'The "%alias_id%" service alias is deprecated. Use " ' .PublisherInterface::class.'" instead. ' );
103+ } else {
104+ $ alias ->setDeprecated (true , 'The "%alias_id%" service alias is deprecated. Use " ' .PublisherInterface::class.'" instead. ' );
105+ }
99106
100107 $ container ->setAlias (PublisherInterface::class, $ defaultHub );
101108 $ container ->setParameter ('mercure.hubs ' , $ hubUrls );
You can’t perform that action at this time.
0 commit comments