Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be8f994

Browse files
Vasilij DuskoVasilij Dusko | CREATION
authored andcommitted
* LightSmsTransport.php - return type
1 parent f2ba226 commit be8f994

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ protected function doSend(MessageInterface $message): SentMessage
132132
if (isset($content['error'])) {
133133
throw new TransportException('Unable to send the SMS: '.$this->errorCodes[$content['error']], $response);
134134
}
135+
136+
137+
$phone = preg_replace("/[^\d]/", "", $message->getPhone());
138+
139+
if ($content[$phone]['error'] == 32) {
140+
throw new TransportException('Unable to send the SMS: '.$this->errorCodes[$content['error']], $response);
141+
}
142+
143+
if ($content[$phone]['error'] == 0) {
144+
$sentMessage = new SentMessage($message, (string) $this);
145+
$sentMessage->setMessageId($content[$phone]['id_sms']);
146+
}
135147
}
136148

137149
private function getSignature(): string

0 commit comments

Comments
 (0)