From 67629df54a14cd25d34c23210b9094def39245b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Mo=CC=88ller?= Date: Sun, 12 Jul 2015 23:09:38 -0400 Subject: [PATCH] Fix: Constraint::addError() does not return anything --- src/JsonSchema/Constraints/TypeConstraint.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 +}