@@ -121,19 +121,19 @@ protected function doSend(MessageInterface $message): SentMessage
121
121
122
122
// it happens if the host without www
123
123
if (isset ($ content ['' ]['error ' ])) {
124
- throw new TransportException ('Unable to send the SMS: ' .$ this ->getErrorMsg ((int )$ content ['' ]['error ' ]), $ response );
124
+ throw new TransportException ('Unable to send the SMS: ' .$ this ->getErrorMsg ((int ) $ content ['' ]['error ' ]), $ response );
125
125
}
126
126
127
127
if (isset ($ content ['error ' ])) {
128
- throw new TransportException ('Unable to send the SMS: ' .$ this ->getErrorMsg ((int )$ content ['error ' ]), $ response );
128
+ throw new TransportException ('Unable to send the SMS: ' .$ this ->getErrorMsg ((int ) $ content ['error ' ]), $ response );
129
129
}
130
130
131
131
$ phone = $ this ->escapePhoneNumber ($ message ->getPhone ());
132
- if (32 === (int )$ content [$ phone ]['error ' ]) {
133
- throw new TransportException ('Unable to send the SMS: ' .$ this ->getErrorMsg ((int )$ content [$ phone ]['error ' ]), $ response );
132
+ if (32 === (int ) $ content [$ phone ]['error ' ]) {
133
+ throw new TransportException ('Unable to send the SMS: ' .$ this ->getErrorMsg ((int ) $ content [$ phone ]['error ' ]), $ response );
134
134
}
135
135
136
- if (0 === (int )$ content [$ phone ]['error ' ]) {
136
+ if (0 === (int ) $ content [$ phone ]['error ' ]) {
137
137
$ sentMessage = new SentMessage ($ message , (string ) $ this );
138
138
$ sentMessage ->setMessageId ($ content [$ phone ]['id_sms ' ]);
139
139
@@ -166,6 +166,6 @@ private function escapePhoneNumber(string $phoneNumber): string
166
166
167
167
private function getErrorMsg (int $ errorCode ): string
168
168
{
169
- return isset ( self ::ERROR_CODES [$ errorCode ]) ? self :: ERROR_CODES [ $ errorCode ] : self ::ERROR_CODES [999 ];
169
+ return self ::ERROR_CODES [$ errorCode ] ?? self ::ERROR_CODES [999 ];
170
170
}
171
171
}
0 commit comments