Skip to content

Commit

Permalink
Merge branch 'main' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierCane authored Dec 11, 2023
2 parents 111e623 + 9d3434e commit a22529a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Shared/Domain/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use DateTimeImmutable;
use DateTimeInterface;
use RuntimeException;
use function Lambdish\Phunctional\filter;

final class Utils
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a22529a

Please sign in to comment.