* type cast. On success lightsms return error code like string. On error return integer.

This commit is contained in:
Vasilij Dusko 2021-04-04 10:52:47 +03:00
parent 0d7488b10a
commit 9b2e2d0b4a

View File

@ -129,11 +129,11 @@ final class LightSmsTransport extends AbstractTransport
} }
$phone = $this->escapePhoneNumber($message->getPhone()); $phone = $this->escapePhoneNumber($message->getPhone());
if (32 === $content[$phone]['error']) { if (32 === (int)$content[$phone]['error']) {
throw new TransportException('Unable to send the SMS: '.$this->getErrorMsg((int)$content[$phone]['error']), $response); throw new TransportException('Unable to send the SMS: '.$this->getErrorMsg((int)$content[$phone]['error']), $response);
} }
if (0 == $content[$phone]['error']) { if (0 == (int)$content[$phone]['error']) {
$sentMessage = new SentMessage($message, (string) $this); $sentMessage = new SentMessage($message, (string) $this);
$sentMessage->setMessageId($content[$phone]['id_sms']); $sentMessage->setMessageId($content[$phone]['id_sms']);