From bdeeae15102fcbd4b5a03d72f77f685f9b164383 Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Fri, 10 May 2019 10:08:25 +0200 Subject: [PATCH] Fix the interface incompatibility of EventDispatchers The `LegacyEventDispatcherProxy` now implements the full `EventDispatcherInterface` from the `EventDispatcherBundle`. Before it just implemented the Interface from the `Contracts` Bundle, that made it incompatible with the `WrappedListener`. This fixes #31457. --- .../Component/EventDispatcher/LegacyEventDispatcherProxy.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php b/src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php index e1f8aaee00d0..86917b7d5438 100644 --- a/src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php +++ b/src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php @@ -13,7 +13,7 @@ use Psr\EventDispatcher\StoppableEventInterface; use Symfony\Contracts\EventDispatcher\Event as ContractsEvent; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface; /** * An helper class to provide BC/FC with the legacy signature of EventDispatcherInterface::dispatch(). @@ -26,7 +26,7 @@ final class LegacyEventDispatcherProxy implements EventDispatcherInterface { private $dispatcher; - public static function decorate(?EventDispatcherInterface $dispatcher): ?EventDispatcherInterface + public static function decorate(?ContractsEventDispatcherInterface $dispatcher): ?ContractsEventDispatcherInterface { if (null === $dispatcher) { return null;