Skip to content

Commit 7557bae

Browse files
committed
fix duplicate call of checkUndefined
1 parent 1a2e961 commit 7557bae

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/JsonSchema/Constraints/Object.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function validateElement($element, $matches, $objectDefinition = null, $p
7575
$property = $this->getProperty($element, $i, new Undefined());
7676
$definition = $this->getProperty($objectDefinition, $i);
7777

78-
//no additional properties allowed
78+
// no additional properties allowed
7979
if (!in_array($i, $matches) && $additionalProp === false && $this->inlineSchemaProperty !== $i && !$definition) {
8080
$this->addError($path, "The property " . $i . " is not defined and the definition does not allow additional properties");
8181
}
@@ -91,8 +91,10 @@ public function validateElement($element, $matches, $objectDefinition = null, $p
9191
$this->addError($path, "the presence of the property " . $i . " requires that " . $require . " also be present");
9292
}
9393

94-
//normal property verification
95-
$this->checkUndefined($value, $definition ? : new \stdClass(), $path, $i);
94+
if( !$definition) {
95+
// normal property verification
96+
$this->checkUndefined($value, new \stdClass(), $path, $i);
97+
}
9698
}
9799
}
98100

0 commit comments

Comments
 (0)