Skip to content

Commit 44adc6f

Browse files
committed
Merge pull request #167 from localheinz/fix/return
Fix: Constraint::addError() does not return anything
2 parents 66c1330 + 67629df commit 44adc6f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/JsonSchema/Constraints/TypeConstraint.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ public function check($value = null, $schema = null, $path = null, $i = null)
6363
}
6464

6565
if (!$validatedOneType) {
66-
return $this->addErrors($errors);
66+
$this->addErrors($errors);
67+
68+
return;
6769
}
6870
} elseif (is_object($type)) {
6971
$this->checkUndefined($value, $type, $path);
@@ -136,4 +138,4 @@ protected function validateType($value, $type)
136138

137139
throw new InvalidArgumentException((is_object($value) ? 'object' : $value) . ' is an invalid type for ' . $type);
138140
}
139-
}
141+
}

0 commit comments

Comments
 (0)