CHECK_MODE_NONE
CHECK_MODE_NONE = 0
The ObjectConstraint Constraints, validates an object against a given schema
$factory : \JsonSchema\Constraints\Factory
__construct(\JsonSchema\Constraints\Factory $factory = null)
\JsonSchema\Constraints\Factory | $factory |
addError(\JsonSchema\Entity\JsonPointer $path = null, $message, $constraint = '', array $more = null)
\JsonSchema\Entity\JsonPointer | $path | |
$message | ||
$constraint | ||
array | $more |
check( $element, $schema = null, \JsonSchema\Entity\JsonPointer $path = null, $properties = null, $additionalProp = null, $patternProperties = null, $appliedDefaults = array())
{@inheritdoc}
$element | ||
$schema | ||
\JsonSchema\Entity\JsonPointer | $path | |
$properties | ||
$additionalProp | ||
$patternProperties | ||
$appliedDefaults |
validatePatternProperties( $element, \JsonSchema\Entity\JsonPointer $path = null, $patternProperties)
$element | ||
\JsonSchema\Entity\JsonPointer | $path | |
$patternProperties |
validateElement(\StdClass $element, array $matches, \StdClass $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, \StdClass $properties = null, mixed $additionalProp = null)
Validates the element properties
\StdClass | $element | Element to validate |
array | $matches | Matches from patternProperties (if any) |
\StdClass | $schema | ObjectConstraint definition |
\JsonSchema\Entity\JsonPointer|null | $path | Current test path |
\StdClass | $properties | Properties |
mixed | $additionalProp | Additional properties |
validateProperties(\stdClass $element, \stdClass $properties = null, \JsonSchema\Entity\JsonPointer|null $path = null)
Validates the definition properties
\stdClass | $element | Element to validate |
\stdClass | $properties | Property definitions |
\JsonSchema\Entity\JsonPointer|null | $path | Path? |
incrementPath(\JsonSchema\Entity\JsonPointer|null $path = null, mixed $i) : \JsonSchema\Constraints\JsonPointer;
Bubble down the path
\JsonSchema\Entity\JsonPointer|null | $path | Current path |
mixed | $i | What to append to the path |
checkArray(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, mixed $i = null)
Validates an array
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer|null | $path | |
mixed | $i |
checkObject(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, mixed $properties = null, mixed $additionalProperties = null, mixed $patternProperties = null, $appliedDefaults = array())
Validates an object
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer|null | $path | |
mixed | $properties | |
mixed | $additionalProperties | |
mixed | $patternProperties | |
$appliedDefaults |
checkType(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, mixed $i = null)
Validates the type of a property
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer|null | $path | |
mixed | $i |
checkUndefined(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, mixed $i = null, $fromDefault = false)
Checks a undefined element
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer|null | $path | |
mixed | $i | |
$fromDefault |
checkString(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, mixed $i = null)
Checks a string element
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer|null | $path | |
mixed | $i |
checkNumber(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer $path = null, mixed $i = null)
Checks a number element
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer | $path | |
mixed | $i |
checkEnum(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, mixed $i = null)
Checks a enum element
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer|null | $path | |
mixed | $i |
checkFormat(mixed $value, mixed $schema = null, \JsonSchema\Entity\JsonPointer|null $path = null, mixed $i = null)
Checks format of an element
mixed | $value | |
mixed | $schema | |
\JsonSchema\Entity\JsonPointer|null | $path | |
mixed | $i |
getTypeCheck() : \JsonSchema\Constraints\TypeCheck\TypeCheckInterface
Get the type check based on the set check mode.
convertJsonPointerIntoPropertyPath(\JsonSchema\Entity\JsonPointer $pointer) : string
\JsonSchema\Entity\JsonPointer | $pointer |
property path
validateMinMaxConstraint(\stdClass $element, \stdClass $objectDefinition, \JsonSchema\Entity\JsonPointer|null $path = null)
validating minimum and maximum property constraints (if present) against an element
\stdClass | $element | Element to validate |
\stdClass | $objectDefinition | ObjectConstraint definition |
\JsonSchema\Entity\JsonPointer|null | $path | Path to test? |