function ObjectConstraint::validateProperties
Validates the definition properties
Parameters
\stdClass $element Element to validate:
\stdClass $properties Property definitions:
JsonPointer|null $path Path?:
1 call to ObjectConstraint::validateProperties()
- ObjectConstraint::check in vendor/
justinrainbow/ json-schema/ src/ JsonSchema/ Constraints/ ObjectConstraint.php - invokes the validation of an element
File
-
vendor/
justinrainbow/ json-schema/ src/ JsonSchema/ Constraints/ ObjectConstraint.php, line 135
Class
- ObjectConstraint
- The ObjectConstraint Constraints, validates an object against a given schema
Namespace
JsonSchema\ConstraintsCode
public function validateProperties(&$element, $properties = null, ?JsonPointer $path = null) {
$undefinedConstraint = $this->factory
->createInstanceFor('undefined');
foreach ($properties as $i => $value) {
$property =& $this->getProperty($element, $i, $undefinedConstraint);
$definition = $this->getProperty($properties, $i);
if (is_object($definition)) {
// Undefined constraint will check for is_object() and quit if is not - so why pass it?
$this->checkUndefined($property, $definition, $path, $i, in_array($i, $this->appliedDefaults));
}
}
}