diff --git a/src/Shared/Domain/Utils.php b/src/Shared/Domain/Utils.php index 7939ff26..443c406e 100644 --- a/src/Shared/Domain/Utils.php +++ b/src/Shared/Domain/Utils.php @@ -6,7 +6,6 @@ use DateTimeImmutable; use DateTimeInterface; -use RuntimeException; use function Lambdish\Phunctional\filter; final class Utils @@ -38,13 +37,7 @@ public static function jsonEncode(array $values): string public static function jsonDecode(string $json): array { - $data = json_decode($json, true); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error()); - } - - return $data; + return json_decode($json, true, flags: JSON_THROW_ON_ERROR); } public static function toSnakeCase(string $text): string