[Notifier] Fix two minor issues

This commit is contained in:
Thomas Calvet 2020-01-06 11:24:48 +01:00
parent 905db59b3a
commit 4f80d4d639
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());