We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 68913e7 + 68038fb commit e5fbc01Copy full SHA for e5fbc01
2 files changed
src/ValidationChain.php
@@ -216,7 +216,7 @@ class ValidationChain
216
private array $error = [];
217
private array $errorArgs = [];
218
219
- /**
+ /**
220
* Constructor for the ValidationChain class.
221
*
222
* @param mixed $value The initial value to be validated.
@@ -440,4 +440,5 @@ public function validate(?string $description = null): void
440
{
441
$this->describe($description);
442
}
443
+
444
src/Validator.php
@@ -567,6 +567,9 @@ public function isResource(): bool
567
*/
568
public function isJson(): bool
569
570
+ if(!is_string($this->value) && !is_numeric($this->value)) {
571
+ return false;
572
+ }
573
json_decode($this->value);
574
return json_last_error() === JSON_ERROR_NONE;
575
0 commit comments