Index

ValidatorError

MMO\core\schemas · 1 symbol · generated 30 Sep 2026

class

ValidatorError

Validator.php:7

One validation failure: which schema keyword ($keywordLocation) rejected which part of the value (Validator::getPath), and why ($message).

class MMO\core\schemas\ValidatorError implements JsonSerializable, Stringable
Namespace
MMO\core\schemas
Implements
JsonSerializable, Stringable

Properties3

keywordLocation

readonly
readonly string $keywordLocation
Type
string

message

readonly
readonly string $message
Type
string

validator

readonly
readonly ?MMO\core\schemas\Validator $validator
Type
null | Validator

Methods3

jsonSerialize()

Validator.php:27
function jsonSerialize(): array
returnsarraya JSON-Schema-output-format-style error: 'keywordLocation', 'instanceLocation', 'error'.

__construct($validator, $keywordLocation, $message)

Validator.php:15
function __construct( ?MMO\core\schemas\Validator $validator, string $keywordLocation, string $message )
$validatornull | Validatorthe (sub-)validator that produced this error -- $validator->getPath() gives the failing value's location. Null for an error that is not a schema's: a value an entity could not even convert (aEntity::setArrayProperty).
$keywordLocationstringthe schema path of the keyword that failed (e.g. 'properties/age/maximum').
$messagestringa human-readable explanation (see Validator::ERROR_TEMPLATES).

__toString()

Validator.php:22
function __toString(): string
returnsstringits message: code that prints an entity's errors can treat them as text