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:
commit
f1c9a7c335
@ -69,7 +69,7 @@ final class NexmoTransport extends AbstractTransport
|
|||||||
|
|
||||||
$result = $response->toArray(false);
|
$result = $response->toArray(false);
|
||||||
foreach ($result['messages'] as $msg) {
|
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);
|
throw new TransportException(sprintf('Unable to send the SMS: %s (%s).', $msg['error-text'], $msg['status']), $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ final class SmsMessage implements MessageInterface
|
|||||||
public static function fromNotification(Notification $notification, Recipient $recipient, string $transport = null): self
|
public static function fromNotification(Notification $notification, Recipient $recipient, string $transport = null): self
|
||||||
{
|
{
|
||||||
if (!$recipient instanceof SmsRecipientInterface) {
|
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());
|
return new self($recipient->getPhone(), $notification->getSubject());
|
||||||
|
Reference in New Issue
Block a user