return $sentMessage;
} $error =
$response->
toArray(false
);
throw new TransportException(sprintf('Unable to send SMS with TurboSMS: Error code %d with message "%s".',
(int) $error['response_code'
],
$error['response_status'
]),
$response);
} private function assertValidFrom(string
$from): void
{ if (mb_strlen($from, 'UTF-8'
) > self::SENDER_LIMIT
) { throw new LengthException(sprintf('The sender length of a TurboSMS message must not exceed %d characters.', self::SENDER_LIMIT
));
} } private function assertValidSubject(string
$subject): void
{ // Detect if there is at least one cyrillic symbol in the text
if (preg_match("/\p{Cyrillic}/u",
$subject)) { $subjectLimit = self::SUBJECT_CYRILLIC_LIMIT;
$symbols = 'cyrillic';
} else { $subjectLimit = self::SUBJECT_LATIN_LIMIT;