Skip to content

Commit

Permalink
minor symfony#20181 [Mailer] Remove unnecessary type checking for the…
Browse files Browse the repository at this point in the history
… method from SentMessageEvent (wkania)

This PR was merged into the 6.4 branch.

Discussion
----------

[Mailer] Remove unnecessary type checking for the method from SentMessageEvent

The getMessage method has been returning **only** SentMessage from the very [beginning](https://github.com/symfony/symfony/pull/47080/files#diff-19459911f97144033a370e7d86ae4e3bab9833c03cfe42e1eb3d71da90b15097R26).

Commits
-------

2bbdc99 Remove unnecessary type checking for the method from SentMessageEvent
  • Loading branch information
xabbuh committed Sep 1, 2024
2 parents 1d675dd + 2bbdc99 commit 6634a89
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1728,14 +1728,10 @@ which is useful for debugging errors::

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Mailer\Event\SentMessageEvent;
use Symfony\Component\Mailer\SentMessage;

public function onMessage(SentMessageEvent $event): void
{
$message = $event->getMessage();
if (!$message instanceof SentMessage) {
return;
}

// do something with the message
}
Expand Down

0 comments on commit 6634a89

Please sign in to comment.