Constants

CHECK_MODE_NONE

CHECK_MODE_NONE = 0

CHECK_MODE_NORMAL

CHECK_MODE_NORMAL = 1

CHECK_MODE_TYPE_CAST

CHECK_MODE_TYPE_CAST = 2

CHECK_MODE_COERCE_TYPES

CHECK_MODE_COERCE_TYPES = 4

CHECK_MODE_APPLY_DEFAULTS

CHECK_MODE_APPLY_DEFAULTS = 8

CHECK_MODE_EXCEPTIONS

CHECK_MODE_EXCEPTIONS = 16

CHECK_MODE_DISABLE_FORMAT

CHECK_MODE_DISABLE_FORMAT = 32

CHECK_MODE_ONLY_REQUIRED_DEFAULTS

CHECK_MODE_ONLY_REQUIRED_DEFAULTS = 128

CHECK_MODE_VALIDATE_SCHEMA

CHECK_MODE_VALIDATE_SCHEMA = 256

Properties

$inlineSchemaProperty

$inlineSchemaProperty : 

Type

$errors

$errors : array

Type

array — Errors

$errorMask

$errorMask : integer

Type

integer — All error types which have occurred

Methods

addError()

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

Parameters

\JsonSchema\Entity\JsonPointer $path
$message
$constraint
array $more

addErrors()

addErrors(array  $errors) 

Parameters

array $errors

getErrors()

getErrors(  $errorContext = \JsonSchema\Validator::ERROR_ALL) 

Parameters

$errorContext

numErrors()

numErrors(  $errorContext = \JsonSchema\Validator::ERROR_ALL) 

Parameters

$errorContext

isValid()

isValid() 

reset()

reset() 

Clears any reported errors. Should be used between multiple validation checks.

getErrorMask()

getErrorMask() : integer

Get the error mask

Returns

integer

arrayToObjectRecursive()

arrayToObjectRecursive(array  $array) : object

Recursively cast an associative array to an object

Parameters

array $array

Returns

object

check()

check(  $element,   $schema = null, \JsonSchema\Entity\JsonPointer  $path = null,   $i = null) 

{@inheritdoc}

Parameters

$element
$schema
\JsonSchema\Entity\JsonPointer $path
$i

incrementPath()

incrementPath(\JsonSchema\Entity\JsonPointer|null  $path = null, mixed  $i) : \JsonSchema\Constraints\JsonPointer;

Bubble down the path

Parameters

\JsonSchema\Entity\JsonPointer|null $path

Current path

mixed $i

What to append to the path

Returns

\JsonSchema\Constraints\JsonPointer;

checkArray()

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

Validates an array

Parameters

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

checkObject()

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

Parameters

mixed $value
mixed $schema
\JsonSchema\Entity\JsonPointer|null $path
mixed $properties
mixed $additionalProperties
mixed $patternProperties
$appliedDefaults

checkType()

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

Validates the type of a property

Parameters

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

checkUndefined()

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

Checks a undefined element

Parameters

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

checkString()

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

Checks a string element

Parameters

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

checkNumber()

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

Checks a number element

Parameters

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

checkEnum()

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

Checks a enum element

Parameters

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

checkFormat()

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

Checks format of an element

Parameters

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

convertJsonPointerIntoPropertyPath()

convertJsonPointerIntoPropertyPath(\JsonSchema\Entity\JsonPointer  $pointer) : string

Parameters

\JsonSchema\Entity\JsonPointer $pointer

Returns

string —

property path

validateDateTime()

validateDateTime(  $datetime,   $format) 

Parameters

$datetime
$format

validateRegex()

validateRegex(  $regex) 

Parameters

$regex

validateColor()

validateColor(  $color) 

Parameters

$color

validateStyle()

validateStyle(  $style) 

Parameters

$style

validatePhone()

validatePhone(  $phone) 

Parameters

$phone

validateHostname()

validateHostname(  $host) 

Parameters

$host