From a18d415f287aba2ef40434ab6415ec589f4a876a Mon Sep 17 00:00:00 2001 From: dpi Date: Wed, 27 Dec 2023 20:12:55 +0800 Subject: [PATCH] fix named arg w json_decode to be consistent with php --- lib/special_cases.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/special_cases.php b/lib/special_cases.php index a4e85a93..bc25d1d6 100644 --- a/lib/special_cases.php +++ b/lib/special_cases.php @@ -24,7 +24,7 @@ * Wrapper for json_decode that throws when an error occurs. * * @param string $json JSON data to parse - * @param bool $assoc When true, returned objects will be converted + * @param bool $associative When true, returned objects will be converted * into associative arrays. * @param int<1, max> $depth User specified recursion depth. * @param int $flags Bitmask of JSON decode options. @@ -33,9 +33,9 @@ * @throws JsonException if the JSON cannot be decoded. * @link http://www.php.net/manual/en/function.json-decode.php */ -function json_decode(string $json, bool $assoc = false, int $depth = 512, int $flags = 0): mixed +function json_decode(string $json, bool $associative = false, int $depth = 512, int $flags = 0): mixed { - $data = \json_decode($json, $assoc, $depth, $flags); + $data = \json_decode($json, $associative, $depth, $flags); if (JSON_ERROR_NONE !== json_last_error()) { throw JsonException::createFromPhpError(); }