\JsonSchema\ConstraintsConstraintInterface

The Constraints Interface

Summary

Methods
Constants
getErrors()
addErrors()
addError()
isValid()
check()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getErrors()

getErrors() : array

returns all collected errors

Returns

array

addErrors()

addErrors(array  $errors) 

adds errors to this validator

Parameters

array $errors

addError()

addError(\JsonSchema\Entity\JsonPointer|null  $path = null, string  $message, string  $constraint = '', array  $more = null) 

adds an error

Parameters

\JsonSchema\Entity\JsonPointer|null $path
string $message
string $constraint

the constraint/rule that is broken, e.g.: 'minLength'

array $more

more array elements to add to the error

isValid()

isValid() : boolean

checks if the validator has not raised errors

Returns

boolean

check()

check(mixed  $value, mixed  $schema = null, \JsonSchema\Entity\JsonPointer|null  $path = null, mixed  $i = null) 

invokes the validation of an element

Parameters

mixed $value
mixed $schema
\JsonSchema\Entity\JsonPointer|null $path
mixed $i

Throws

\JsonSchema\Exception\ExceptionInterface