Index

NullValidator

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

class

NullValidator

Validator.php:350

Validator for a null value -- adds no keywords of its own beyond Validator::KEYS.

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

Methods1

Inherited members (21)
ConstantsDeclared byDescription
ERROR_TEMPLATESValidatorHuman-readable message template per keyword, used by toError.
KEYSValidatorKeywords this validator type checks (see getIterator) -- each subclass adds its own type-specific keywords on top of these type-agnostic ones.
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