File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change 2323use Respect \Validation \Message \Template ;
2424use Respect \Validation \Validators \Core \Simple ;
2525
26- use function function_exists ;
2726use function is_string ;
28- use function json_decode ;
29- use function json_last_error ;
3027use function json_validate ;
3128
32- use const JSON_ERROR_NONE ;
33-
3429#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE )]
3530#[Template(
3631 '{{subject}} must be a valid JSON string ' ,
@@ -44,12 +39,6 @@ public function isValid(mixed $input): bool
4439 return false ;
4540 }
4641
47- if (function_exists ('json_validate ' )) {
48- return json_validate ($ input );
49- }
50-
51- json_decode ($ input );
52-
53- return json_last_error () === JSON_ERROR_NONE ;
42+ return json_validate ($ input );
5443 }
5544}
You can’t perform that action at this time.
0 commit comments