Skip to content

Commit

Permalink
Compatibility with Symfony 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHemery committed Dec 10, 2020
1 parent 7ff398b commit d939d22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions FakeSmsTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Mime\Email;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;

Expand Down Expand Up @@ -45,10 +46,10 @@ public function supports(MessageInterface $message): bool

/**
* @param MessageInterface|SmsMessage $message
* @return void
* @return SentMessage
* @throws TransportExceptionInterface
*/
protected function doSend(MessageInterface $message): void
protected function doSend(MessageInterface $message): SentMessage
{
if (!$this->supports($message)) {
throw new LogicException(sprintf(
Expand All @@ -72,5 +73,7 @@ protected function doSend(MessageInterface $message): void
->text($message->getSubject());

$this->mailer->send($email);

return new SentMessage($message, (string)$this);
}
}
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
],
"require": {
"php": ">=7.4.0",
"symfony/http-client": "^4.3|^5.1",
"symfony/notifier": "~5.1.0",
"symfony/http-client": "^4.3|^5.0",
"symfony/notifier": "^5.2",
"symfony/event-dispatcher-contracts": "^2",
"symfony/mailer": "^5.1"
"symfony/mailer": "^5.2"
},
"require-dev": {
"phpunit/phpunit": "^6.5 || ^7",
Expand Down

0 comments on commit d939d22

Please sign in to comment.