Skip to content

Commit

Permalink
[Notifier] Use LegacyEventDispatcherProxy in case the legacy event st…
Browse files Browse the repository at this point in the history
…ill exists
  • Loading branch information
jschaedl committed Feb 24, 2020
1 parent 3809d90 commit 2786993
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Symfony/Component/Notifier/Transport/NullTransport.php
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Notifier\Transport;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Notifier\Event\MessageEvent;
use Symfony\Component\Notifier\Message\MessageInterface;
Expand All @@ -27,7 +28,7 @@ class NullTransport implements TransportInterface

public function __construct(EventDispatcherInterface $dispatcher = null)
{
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
}

public function send(MessageInterface $message): void
Expand Down

0 comments on commit 2786993

Please sign in to comment.