minor #35220 [Notifier] Fix two minor issues (fancyweb)

This PR was merged into the 5.0 branch.

Discussion
----------

[Notifier] Fix two minor issues

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

Commits
-------

4f80d4d639 [Notifier] Fix two minor issues
This commit is contained in:
Fabien Potencier 2020-01-06 13:35:53 +01:00
commit f1c9a7c335
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ final class NexmoTransport extends AbstractTransport
$result = $response->toArray(false);
foreach ($result['messages'] as $msg) {
if ($msg['status'] ?? 0 > 0) {
if ($msg['status'] ?? false) {
throw new TransportException(sprintf('Unable to send the SMS: %s (%s).', $msg['error-text'], $msg['status']), $response);
}
}

View File

@ -37,7 +37,7 @@ final class SmsMessage implements MessageInterface
public static function fromNotification(Notification $notification, Recipient $recipient, string $transport = null): self
{
if (!$recipient instanceof SmsRecipientInterface) {
throw new LogicException(sprintf('To send a SMS message, "%s" should implement "%s" or the recipient should implement "%s".', get_class($notification), SmsNotificationInterface::class, SmsRecipientInterface::class));
throw new LogicException(sprintf('To send a SMS message, "%s" should implement "%s" or the recipient should implement "%s".', \get_class($notification), SmsNotificationInterface::class, SmsRecipientInterface::class));
}
return new self($recipient->getPhone(), $notification->getSubject());