We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bee97ae commit 0381718Copy full SHA for 0381718
1 file changed
src/Validators/Json.php
@@ -23,14 +23,9 @@
23
use Respect\Validation\Message\Template;
24
use Respect\Validation\Validators\Core\Simple;
25
26
-use function function_exists;
27
use function is_string;
28
-use function json_decode;
29
-use function json_last_error;
30
use function json_validate;
31
32
-use const JSON_ERROR_NONE;
33
-
34
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
35
#[Template(
36
'{{subject}} must be a valid JSON string',
@@ -44,12 +39,6 @@ public function isValid(mixed $input): bool
44
39
return false;
45
40
}
46
41
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);
54
43
55
0 commit comments