Skip to content

Commit 4559a65

Browse files
committed
bug #31459 Fix the interface incompatibility of EventDispatchers (keulinho)
This PR was merged into the 4.3 branch. Discussion ---------- 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. | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31457 | License | MIT | Doc PR | / Commits ------- bdeeae1 Fix the interface incompatibility of EventDispatchers
2 parents 48233b0 + bdeeae1 commit 4559a65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Psr\EventDispatcher\StoppableEventInterface;
1515
use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
16+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface;
1717

1818
/**
1919
* An helper class to provide BC/FC with the legacy signature of EventDispatcherInterface::dispatch().
@@ -26,7 +26,7 @@ final class LegacyEventDispatcherProxy implements EventDispatcherInterface
2626
{
2727
private $dispatcher;
2828

29-
public static function decorate(?EventDispatcherInterface $dispatcher): ?EventDispatcherInterface
29+
public static function decorate(?ContractsEventDispatcherInterface $dispatcher): ?ContractsEventDispatcherInterface
3030
{
3131
if (null === $dispatcher) {
3232
return null;

0 commit comments

Comments
 (0)