@@ -41,7 +41,7 @@ public static function encode($data, int $options = 0, int $depth = 512): string
4141 try {
4242 return json_encode ($ data , $ options , $ depth );
4343 } catch (JsonException $ e ) {
44- throw new JsonException ('JSON encoding failed: ' . $ e ->getMessage (), $ e ->getCode (), $ e );
44+ throw new Exception ('JSON encoding failed: ' . $ e ->getMessage (), $ e ->getCode (), $ e );
4545 }
4646 }
4747
@@ -56,13 +56,13 @@ public static function encode($data, int $options = 0, int $depth = 512): string
5656 * @return mixed Decoded data
5757 * @throws Exception If decoding fails
5858 */
59- public static function decode (string $ json , bool $ associative = false , int $ depth = 512 , int $ options = self :: DEFAULT_DECODE_OPTIONS )
59+ public static function decode (string $ json , bool $ associative = false , int $ depth = 512 , int $ options = 0 )
6060 {
6161 $ options = $ options | self ::DEFAULT_DECODE_OPTIONS ; // Ensure default options are applied
6262 try {
6363 return json_decode ($ json , $ associative , $ depth , $ options );
6464 } catch (JsonException $ e ) {
65- throw new JsonException ('JSON decoding failed: ' . $ e ->getMessage (), $ e ->getCode (), $ e );
65+ throw new Exception ('JSON decoding failed: ' . $ e ->getMessage (), $ e ->getCode (), $ e );
6666 }
6767 }
6868
0 commit comments