From 246810dc119a5f2d254109cc4c916f1e204141fa Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Mon, 2 Sep 2024 16:10:08 -0300 Subject: [PATCH] Use json_validate --- src/Validator.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Validator.php b/src/Validator.php index 757b3e3..bc09f5f 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -174,8 +174,7 @@ public static function json(string $field, array $data) : bool if ($data === null) { return false; } - \json_decode($data); - return \json_last_error() === \JSON_ERROR_NONE; + return \json_validate($data); } /**