@@ -103,11 +103,6 @@ public function validateElement($element, $matches, $objectDefinition = null, $p
103
103
$ this ->addError ($ path , "The presence of the property " . $ i . " requires that " . $ require . " also be present " , 'requires ' );
104
104
}
105
105
106
- if (!$ definition ) {
107
- // normal property verification
108
- $ this ->checkUndefined ($ value , new \stdClass (), $ path , $ i );
109
- }
110
-
111
106
$ property = $ this ->getProperty ($ element , $ i , new UndefinedConstraint ());
112
107
if (is_object ($ property )) {
113
108
$ this ->validateMinMaxConstraint (!($ property instanceof UndefinedConstraint) ? $ property : $ element , $ definition , $ path );
@@ -127,7 +122,11 @@ public function validateDefinition($element, $objectDefinition = null, $path = n
127
122
foreach ($ objectDefinition as $ i => $ value ) {
128
123
$ property = $ this ->getProperty ($ element , $ i , new UndefinedConstraint ());
129
124
$ definition = $ this ->getProperty ($ objectDefinition , $ i );
130
- $ this ->checkUndefined ($ property , $ definition , $ path , $ i );
125
+
126
+ if (is_object ($ definition )) {
127
+ // Undefined constraint will check for is_object() and quit if is not - so why pass it?
128
+ $ this ->checkUndefined ($ property , $ definition , $ path , $ i );
129
+ }
131
130
}
132
131
}
133
132
0 commit comments