Skip to content

Commit 05933b2

Browse files
committed
This patch fixes #215 by ensuring that $value is not just an object but also not an instance of itself.
1 parent dc048c6 commit 05933b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonSchema/Constraints/UndefinedConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ protected function validateCommonProperties($value, $schema = null, $path = null
166166
}
167167

168168
// Verify minimum and maximum number of properties
169-
if (is_object($value)) {
169+
if (is_object($value) && !($value instanceof UndefinedConstraint)) {
170170
if (isset($schema->minProperties)) {
171171
if (count(get_object_vars($value)) < $schema->minProperties) {
172172
$this->addError($path, "Must contain a minimum of " . $schema->minProperties . " properties", 'minProperties', array('minProperties' => $schema->minProperties,));

0 commit comments

Comments
 (0)