Skip to content

Commit 236adfd

Browse files
committed
fix: lint
1 parent 8310ae9 commit 236adfd

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

lib/EasyPost/Exception/Api/ApiException.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,16 @@ public function __construct(string $message = '', ?int $httpStatus = null, ?stri
3939
$this->errors = [];
4040
$this->code = null;
4141

42-
try {
43-
$this->jsonBody = isset($httpBody) ? json_decode($httpBody, true) : null;
42+
$this->jsonBody = isset($httpBody) ? json_decode($httpBody, true) : null;
4443

45-
// Set `errors` property
46-
if (isset($this->jsonBody) && !empty($this->jsonBody['error']['errors'])) {
47-
$this->errors = $this->jsonBody['error']['errors'];
48-
}
44+
// Set `errors` property
45+
if (isset($this->jsonBody) && !empty($this->jsonBody['error']['errors'])) {
46+
$this->errors = $this->jsonBody['error']['errors'];
47+
}
4948

50-
// Set `code` property
51-
if (isset($this->jsonBody) && !empty($this->jsonBody['error']['code'])) {
52-
$this->code = $this->jsonBody['error']['code'];
53-
}
54-
} catch (Exception $e) {
55-
$this->jsonBody = null;
49+
// Set `code` property
50+
if (isset($this->jsonBody) && !empty($this->jsonBody['error']['code'])) {
51+
$this->code = $this->jsonBody['error']['code'];
5652
}
5753
}
5854

lib/EasyPost/Http/Requestor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private static function absoluteUrl(EasyPostClient $client, string $url = '', bo
5555
public static function utf8(mixed $value): string
5656
{
5757
if (is_string($value) && mb_detect_encoding($value, 'UTF-8', true) != 'UTF-8') {
58-
return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
58+
return (string)mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
5959
}
6060

6161
return $value;

0 commit comments

Comments
 (0)