\JsonSchema\ConstraintsFactory

Factory for centralize constraint initialization.

Summary

Methods
Properties
Constants
__construct()
setConfig()
addConfig()
removeConfig()
getConfig()
getUriRetriever()
getSchemaStorage()
getTypeCheck()
setConstraintClass()
createInstanceFor()
getErrorContext()
setErrorContext()
No public properties found
No constants found
No protected methods found
$schemaStorage
$uriRetriever
$errorContext
$constraintMap
N/A
No private methods found
$checkMode
$typeCheck
$instanceCache
N/A

Properties

$errorContext

$errorContext : integer

Type

integer — Validation context

$constraintMap

$constraintMap : array

Type

array

$checkMode

$checkMode : integer

Type

integer

$instanceCache

$instanceCache : \JsonSchema\Constraints\array<ConstraintInterface>

Type

\JsonSchema\Constraints\array

Methods

__construct()

__construct(\JsonSchema\SchemaStorage  $schemaStorage = null, \JsonSchema\UriRetrieverInterface  $uriRetriever = null, integer  $checkMode = \JsonSchema\Constraints\Constraint::CHECK_MODE_NORMAL) 

Parameters

\JsonSchema\SchemaStorage $schemaStorage
\JsonSchema\UriRetrieverInterface $uriRetriever
integer $checkMode

setConfig()

setConfig(integer  $checkMode = \JsonSchema\Constraints\Constraint::CHECK_MODE_NORMAL) 

Set config values

Parameters

integer $checkMode

Set checkMode options - does not preserve existing flags

addConfig()

addConfig(integer  $options) 

Enable checkMode flags

Parameters

integer $options

removeConfig()

removeConfig(integer  $options) 

Disable checkMode flags

Parameters

integer $options

getConfig()

getConfig(integer  $options = null) : integer

Get checkMode option

Parameters

integer $options

Options to get, if null then return entire bitmask

Returns

integer

getSchemaStorage()

getSchemaStorage() 

getTypeCheck()

getTypeCheck() 

setConstraintClass()

setConstraintClass(string  $name, string  $class) : \JsonSchema\Constraints\Factory

Parameters

string $name
string $class

Returns

\JsonSchema\Constraints\Factory

createInstanceFor()

createInstanceFor(string  $constraintName) : \JsonSchema\Constraints\ConstraintInterface|\JsonSchema\Constraints\ObjectConstraint

Create a constraint instance for the given constraint name.

Parameters

string $constraintName

Throws

\JsonSchema\Exception\InvalidArgumentException

if is not possible create the constraint instance

Returns

\JsonSchema\Constraints\ConstraintInterface|\JsonSchema\Constraints\ObjectConstraint

getErrorContext()

getErrorContext() : string

Get the error context

Returns

string

setErrorContext()

setErrorContext(  $errorContext) 

Set the error context

Parameters

$errorContext