function Json::prettify
Throws
1 call to Json::prettify()
- JsonMatches::fail in vendor/
phpunit/ phpunit/ src/ Framework/ Constraint/ JsonMatches.php - Throws an exception for the given compared value and test description.
File
-
vendor/
phpunit/ phpunit/ src/ Util/ Json.php, line 33
Class
- Json
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\UtilCode
public static function prettify(string $json) : string {
$decodedJson = json_decode($json, false);
if (json_last_error()) {
throw new InvalidJsonException();
}
return json_encode($decodedJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}