Skip to content

Commit

Permalink
Merge pull request #167 from localheinz/fix/return
Browse files Browse the repository at this point in the history
Fix: Constraint::addError() does not return anything
  • Loading branch information
bighappyface committed Jul 13, 2015
2 parents 66c1330 + 67629df commit 44adc6f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/JsonSchema/Constraints/TypeConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -136,4 +138,4 @@ protected function validateType($value, $type)

throw new InvalidArgumentException((is_object($value) ? 'object' : $value) . ' is an invalid type for ' . $type);
}
}
}

0 comments on commit 44adc6f

Please sign in to comment.