Index

InstanceValidator

MMO\core\schemas · 1 symbol · generated 5 Oct 2026

class

InstanceValidator

Validator.php:443

Validator for a PHP object value: 'instanceOf' (this framework's own extension keyword, not part of the JSON Schema spec).

class MMO\core\schemas\InstanceValidator extends MMO\core\schemas\Validator
Namespace
MMO\core\schemas
Extends
Validator

Index

KEYS
isValidType($types)
validate_instanceOf()'instanceOf': the value must be an instance of at least one of the listed classes/interfaces.

Constants1

KEYS

const KEYS = ['instanceOf', 'enum', 'const', 'allOf', 'anyOf', 'oneOf', 'not', 'if']

Methods2

validate_instanceOf()

Validator.php:451

'instanceOf': the value must be an instance of at least one of the listed classes/interfaces.

protected function validate_instanceOf(): Generator
returnsGenerator
Inherited members (20)
ConstantsDeclared byDescription
ERROR_TEMPLATESValidatorHuman-readable message template per keyword, used by toError.
PropertiesDeclared byDescription
keyValidatorThis validator's key/index within its $parent (e.g.
parentValidatorThe validator for the enclosing value, or null at the root.
schemaValidatorThe schema it's validated against.
valueValidatorThe value being validated.
MethodsDeclared byDescription
createInPlaceValidator($schema)ValidatorA validator of this same value against another schema: an allOf/anyOf/oneOf branch, not, if/then/else, a dependent schema.
describeAssert($assert)ValidatorWhat a failing keyword expected, as plain text: a list of types reads null|string.
getIterator()Validator\IteratorAggregate::getIterator -- yields schemaPath => Validator for every keyword this value fails (the Validator being the (sub-)validator whose value actually failed that keyword, not necessa…
getPath($join)Validator
Reorder($value)ValidatorRecursively sort $value's keys (and, in turn, every nested array's keys), in place -- used before comparing two structures for equality regardless of key order (validate_enum/validate_const).
setParent($validator, $key)ValidatorAttach this validator (for a nested value) under $validator, at $key (a property name or array index) -- used to build getPath.
toError($schemaPath)ValidatorBuild a human-readable error for a failing schema path (a key yielded by getIterator/a validate_* method), this validator being the one that failed.
validate_allOf()Validator'allOf': the value must validate against every listed schema; each schema's own failures are all yielded (not just the first).
validate_anyOf()Validator'anyOf': the value must validate against at least one listed schema; if none match, every schema's failures are yielded together.
validate_const()Validator'const': same as a single-value validate_enum.
validate_enum()Validator'enum': the value must strictly equal (order-independent for arrays/objects, and int/float-interchangeable for whole numbers) one of the declared constants.
validate_if()Validator'if'/'then'/'else': validates against 'then' if the value matches 'if', otherwise against 'else' (each defaulting to TrueSchema, i.e.
validate_not()Validator'not': the value must NOT validate against the given schema.
validate_oneOf()Validator'oneOf': the value must validate against exactly one listed schema -- matching zero (all schemas' failures yielded) or more than one (a single "matched more than one" error) both fail.
__construct($schema, $value)Validator