CHECK_MODE_NONE
CHECK_MODE_NONE = 0
The TypeConstraint Constraints, validates an element against a given type
$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( $value = null, $schema = null, \JsonSchema\Entity\JsonPointer $path = null, $i = null)
{@inheritdoc}
$value | ||
$schema | ||
\JsonSchema\Entity\JsonPointer | $path | |
$i |
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
validateTypesArray(mixed $value, array $type, array $validTypesWording, boolean $isValid, $path)
Validates the given $value against the array of types in $type. Sets the value of $isValid to true, if at least one $type mateches the type of $value or the value passed as $isValid is already true.
mixed | $value | Value to validate |
array | $type | TypeConstraints to check agains |
array | $validTypesWording | An array of wordings of the valid types of the array $type |
boolean | $isValid | The current validation value |
$path |
implodeWith(array $elements, string $delimiter = ', ', boolean $listEnd = false) : string
Implodes the given array like implode() with turned around parameters and with the difference, that, if $listEnd isn't false, the last element delimiter is $listEnd instead of $delimiter.
array | $elements | The elements to implode |
string | $delimiter | The delimiter to use |
boolean | $listEnd | The last delimiter to use (defaults to $delimiter) |