BaseConstraint
in package
A more basic constraint definition - used for the public interface to avoid exposing library internals.
Table of Contents
Properties
- $errorMask : int
- $errors : array<string|int, mixed>
- $factory : Factory
Methods
- __construct() : mixed
- addError() : mixed
- addErrors() : mixed
- arrayToObjectRecursive() : object
- Recursively cast an associative array to an object
- getErrorMask() : int
- Get the error mask
- getErrors() : mixed
- isValid() : mixed
- numErrors() : mixed
- reset() : mixed
- Clears any reported errors. Should be used between multiple validation checks.
Properties
$errorMask
protected
int
$errorMask
= \JsonSchema\Validator::ERROR_NONE
All error types which have occurred
$errors
protected
array<string|int, mixed>
$errors
= array()
Errors
$factory
protected
Factory
$factory
Methods
__construct()
public
__construct([Factory $factory = null ]) : mixed
Parameters
- $factory : Factory = null
addError()
public
addError([JsonPointer $path = null ], mixed $message[, mixed $constraint = '' ][, array<string|int, mixed> $more = null ]) : mixed
Parameters
- $path : JsonPointer = null
- $message : mixed
- $constraint : mixed = ''
- $more : array<string|int, mixed> = null
addErrors()
public
addErrors(array<string|int, mixed> $errors) : mixed
Parameters
- $errors : array<string|int, mixed>
arrayToObjectRecursive()
Recursively cast an associative array to an object
public
static arrayToObjectRecursive(array<string|int, mixed> $array) : object
Parameters
- $array : array<string|int, mixed>
Return values
objectgetErrorMask()
Get the error mask
public
getErrorMask() : int
Return values
intgetErrors()
public
getErrors([mixed $errorContext = Validator::ERROR_ALL ]) : mixed
Parameters
- $errorContext : mixed = Validator::ERROR_ALL
isValid()
public
isValid() : mixed
numErrors()
public
numErrors([mixed $errorContext = Validator::ERROR_ALL ]) : mixed
Parameters
- $errorContext : mixed = Validator::ERROR_ALL
reset()
Clears any reported errors. Should be used between multiple validation checks.
public
reset() : mixed