Skip to content

Commit 33ff92f

Browse files
committed
attempt about getting Larastan to pass
1 parent caca23e commit 33ff92f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Bulksms.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ private function character_resolve(string $body): string
9393

9494
$ret_msg = '';
9595
if (mb_detect_encoding($body, 'UTF-8') != 'UTF-8') {
96-
$body = mb_convert_encoding($body, 'UTF-8', 'auto');
96+
$converted = mb_convert_encoding($body, 'UTF-8', 'auto');
97+
if ($converted == false) {
98+
throw new \RuntimeException('Failed to convert string encoding to UTF-8');
99+
}
100+
$body = $converted;
97101
}
98102
for ($i = 0; $i < mb_strlen($body, 'UTF-8'); $i++) {
99103
$c = mb_substr($body, $i, 1, 'UTF-8');

0 commit comments

Comments
 (0)