feature #37403 [Notifier] Return SentMessage from the Notifier message handler (fabpot)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Return SentMessage from the Notifier message handler

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | see https://github.com/symfony/symfony/pull/36611#issuecomment-648448026 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        |

Commits
-------

5855d112b7 [Notifier] Return SentMessage from the Notifier message handler
This commit is contained in:
Fabien Potencier 2020-06-24 10:47:24 +02:00
commit 3308b25fe4

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Notifier\Messenger;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\TransportInterface;
/**
@ -28,8 +29,8 @@ final class MessageHandler
$this->transport = $transport;
}
public function __invoke(MessageInterface $message)
public function __invoke(MessageInterface $message): ?SentMessage
{
$this->transport->send($message);
return $this->transport->send($message);
}
}