Documentations › mmo.core › php › schemas ValidatorError MMO\core\schemas · 1 symbol · generated 30 Sep 2026
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\schemasImplements JsonSerializable , Stringable Properties3 readonly string $keywordLocation Type string readonly string $message Type string readonly ?MMO\core\schemas\Validator $validator Type null | Validator Methods3 function jsonSerialize(): array returns array a JSON-Schema-output-format-style error: 'keywordLocation', 'instanceLocation', 'error'.
function __construct(
?MMO\core\schemas\Validator $validator,
string $keywordLocation,
string $message
) $validator null | Validator the (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 ). $keywordLocation string the schema path of the keyword that failed (e.g. 'properties/age/maximum'). $message string a human-readable explanation (see Validator::ERROR_TEMPLATES ).
function __toString(): string returns string its message: code that prints an entity's errors can treat them as text