bug #33707 [Mailer] ensure legacy event dispatcher compatibility (xabbuh)

This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] ensure legacy event dispatcher compatibility

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

860688ff2e ensure legacy event dispatcher compatibility
This commit is contained in:
Fabien Potencier 2019-09-25 16:56:38 +02:00
commit 5d4f302048

View File

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