diff --git a/src/JsonSchema/Constraints/TypeConstraint.php b/src/JsonSchema/Constraints/TypeConstraint.php index 3c439d54..18318157 100644 --- a/src/JsonSchema/Constraints/TypeConstraint.php +++ b/src/JsonSchema/Constraints/TypeConstraint.php @@ -63,7 +63,9 @@ public function check($value = null, $schema = null, $path = null, $i = null) } if (!$validatedOneType) { - return $this->addErrors($errors); + $this->addErrors($errors); + + return; } } elseif (is_object($type)) { $this->checkUndefined($value, $type, $path); @@ -136,4 +138,4 @@ protected function validateType($value, $type) throw new InvalidArgumentException((is_object($value) ? 'object' : $value) . ' is an invalid type for ' . $type); } -} \ No newline at end of file +}