We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f829f27 commit f694dc1Copy full SHA for f694dc1
src/Formatters/Json.php
@@ -6,5 +6,11 @@
6
7
function format(array $diff): string
8
{
9
- return json_encode($diff, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
+ $json = json_encode($diff, JSON_PRETTY_PRINT);
10
+
11
+ if (json_last_error() !== JSON_ERROR_NONE) {
12
+ throw new \Exception("JSON encoding error: " . json_last_error_msg());
13
+ }
14
15
+ return $json;
16
}
0 commit comments