diff --git a/src/JsonFormatter.php b/src/JsonFormatter.php index 069a5fd1..395503ad 100644 --- a/src/JsonFormatter.php +++ b/src/JsonFormatter.php @@ -29,7 +29,7 @@ final class JsonFormatter * * @return string */ - public static function format($json, $unescapeUnicode, $unescapeSlashes) + public static function format(string $json, bool $unescapeUnicode, bool $unescapeSlashes): string { $result = ''; $pos = 0; @@ -63,7 +63,7 @@ public static function format($json, $unescapeUnicode, $unescapeSlashes) if ($unescapeUnicode && \function_exists('mb_convert_encoding')) { // https://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha - $buffer = \preg_replace_callback('/(\\\\+)u([0-9a-f]{4})/i', function ($match) { + $buffer = \preg_replace_callback('/(\\\\+)u([0-9a-f]{4})/i', function (array $match) { $l = \strlen($match[1]); if ($l % 2) {