8000 [Notifier] Use LegacyEventDispatcherProxy in case the legacy event st… · symfony/symfony@2786993 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2786993

Browse files
committed
[Notifier] Use LegacyEventDispatcherProxy in case the legacy event still exists
1 parent 3809d90 commit 2786993

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Notifier/Transport/NullTransport.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Notifier\Transport;
1313

14+
use Symfony\Component\EventDispatcher\Event;
1415
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
1516
use Symfony\Component\Notifier\Event\MessageEvent;
1617
use Symfony\Component\Notifier\Message\MessageInterface;
@@ -27,7 +28,7 @@ class NullTransport implements TransportInterface
2728

2829
public function __construct(EventDispatcherInterface $dispatcher = null)
2930
{
30-
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
31+
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
3132
}
3233

3334
public function send(MessageInterface $message): void

0 commit comments

Comments
 (0)
0