Skip to content

Commit 33d3f1d

Browse files
committed
feature #32295 [FrameworkBundle] Add autowiring alias for PSR-14 (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Add autowiring alias for PSR-14 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 2d5bcda9e7 [FrameworkBundle] Add autowiring alias for PSR-14
2 parents b9950ca + 8d221b3 commit 33d3f1d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Http\Client\HttpClient;
1717
use Psr\Cache\CacheItemPoolInterface;
1818
use Psr\Container\ContainerInterface as PsrContainerInterface;
19+
use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface;
1920
use Psr\Http\Client\ClientInterface;
2021
use Psr\Log\LoggerAwareInterface;
2122
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
@@ -154,6 +155,10 @@ public function load(array $configs, ContainerBuilder $container)
154155
$loader->load('fragment_renderer.xml');
155156
$loader->load('error_catcher.xml');
156157

158+
if (interface_exists(PsrEventDispatcherInterface::class)) {
159+
$container->setAlias(PsrEventDispatcherInterface::class, 'event_dispatcher');
160+
}
161+
157162
$container->registerAliasForArgument('parameter_bag', PsrContainerInterface::class);
158163

159164
if (class_exists(Application::class)) {

0 commit comments

Comments
 (0)