Skip to content

Commit a6b589e

Browse files
committed
minor #40733 * LightSmsTransport.php - suggestion for pull request #40712 (StaffNowa)
This PR was merged into the 5.3-dev branch. Discussion ---------- * LightSmsTransport.php - suggestion for pull request #40712 | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #40712 | License | MIT | Doc PR | - After remove issets still get warnings about undefined variables. My solution for this: 1. Create method which have all issets cases. 2. Return (int) errorCode Commits ------- 0b1a450 * LightSmsTransport.php
2 parents fe9b188 + 0b1a450 commit a6b589e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ protected function doSend(MessageInterface $message): SentMessage
124124

125125
$content = $response->toArray(false);
126126

127-
if (0 !== (int) $content[$phone]['error'] ?? -1) {
128-
$errorCode = (int) $content['error'] ?? $content['']['error'] ?? $content[$phone]['error'] ?? -1;
127+
if (0 !== (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1) {
128+
$errorCode = (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1;
129129
if (-1 === $errorCode) {
130130
throw new TransportException('Unable to send the SMS.', $response);
131131
}

0 commit comments

Comments
 (0)