Skip to content

Commit

Permalink
Replace json_*() with Nette\Utils\Json
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Sep 26, 2019
1 parent 32921d8 commit a528011
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ErrorHandler/SimpleErrorHandler.php
Expand Up @@ -7,6 +7,7 @@
use Apitte\Core\Exception\Runtime\SnapshotException;
use Apitte\Core\Http\ApiResponse;
use GuzzleHttp\Psr7\Response;
use Nette\Utils\Json;
use Throwable;
use function GuzzleHttp\Psr7\stream_for;

Expand Down Expand Up @@ -57,7 +58,7 @@ protected function createResponseFromError(Throwable $error): ApiResponse
$data['context'] = $context;
}

$body = stream_for(json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | (defined('JSON_PRESERVE_ZERO_FRACTION') ? JSON_PRESERVE_ZERO_FRACTION : 0)));
$body = stream_for(Json::encode($data));

$response = new ApiResponse(new Response());
return $response
Expand Down

0 comments on commit a528011

Please sign in to comment.