Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ObjectConstraint.php

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\Constraints

Code

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));
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal