Skip to content

Commit

Permalink
bug #31459 Fix the interface incompatibility of EventDispatchers (keu…
Browse files Browse the repository at this point in the history
…linho)

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
  • Loading branch information
fabpot committed May 13, 2019
2 parents 48233b0 + bdeeae1 commit 4559a65
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -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().
Expand All @@ -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;
Expand Down

0 comments on commit 4559a65

Please sign in to comment.