@@ -56,22 +56,22 @@ private function __construct(string $json, bool $associative = false, int $depth
5656 * The parameters exactly match PHP's json_decode() function - see
5757 * http://php.net/manual/en/function.json-decode.php for more information.
5858 *
59- * @param string $source The JSON string being decoded.
59+ * @param string $json The JSON string being decoded.
6060 * @param bool $associative When TRUE, returned objects will be converted into associative arrays.
6161 * @param int $depth User specified recursion depth.
62- * @param int $options Bitmask of JSON decode options.
62+ * @param int $flags Bitmask of JSON decode options.
6363 *
6464 * @throws SyntaxError if the JSON encoded string could not be parsed.
6565 *
6666 * @return mixed
6767 */
68- public static function decode (string $ source , ?bool $ associative = false , int $ depth = 512 , int $ options = 0 )
68+ public static function decode (string $ json , ?bool $ associative = false , int $ depth = 512 , int $ flags = 0 )
6969 {
7070 // Try parsing with json_decode first, since that's much faster
7171 // We only attempt this on PHP 7+ because 5.x doesn't parse some edge cases correctly
7272 if (PHP_VERSION_ID >= 70000 ) {
7373 try {
74- $ result = \json_decode ($ source , $ associative , $ depth , $ options );
74+ $ result = \json_decode ($ json , $ associative , $ depth , $ flags );
7575 if (\json_last_error () === \JSON_ERROR_NONE ) {
7676 return $ result ;
7777 }
@@ -81,10 +81,10 @@ public static function decode(string $source, ?bool $associative = false, int $d
8181 }
8282
8383 // Fall back to JSON5 if that fails
84- $ associative = $ associative === true || ($ associative === null && $ options & \JSON_OBJECT_AS_ARRAY );
85- $ castBigIntToString = $ options & \JSON_BIGINT_AS_STRING ;
84+ $ associative = $ associative === true || ($ associative === null && $ flags & \JSON_OBJECT_AS_ARRAY );
85+ $ castBigIntToString = $ flags & \JSON_BIGINT_AS_STRING ;
8686
87- $ decoder = new self ($ source , $ associative , $ depth , $ castBigIntToString );
87+ $ decoder = new self ($ json , $ associative , $ depth , $ castBigIntToString );
8888
8989 $ result = $ decoder ->value ();
9090 $ decoder ->white ();
0 commit comments