ensure legacy event dispatcher compatibility

This commit is contained in:
Christian Flothmann 2019-09-25 16:21:59 +02:00
parent 1595d307cf
commit 860688ff2e

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Mailer; namespace Symfony\Component\Mailer;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Mailer\Event\MessageEvent; use Symfony\Component\Mailer\Event\MessageEvent;
use Symfony\Component\Mailer\Messenger\SendEmailMessage; use Symfony\Component\Mailer\Messenger\SendEmailMessage;
use Symfony\Component\Mailer\Transport\TransportInterface; use Symfony\Component\Mailer\Transport\TransportInterface;
@ -31,7 +32,7 @@ final class Mailer implements MailerInterface
{ {
$this->transport = $transport; $this->transport = $transport;
$this->bus = $bus; $this->bus = $bus;
$this->dispatcher = $dispatcher; $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
} }
public function send(RawMessage $message, Envelope $envelope = null): void public function send(RawMessage $message, Envelope $envelope = null): void