MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

ValidatorError

MMO\core\schemas · 1 symbol · generated 27 Oct 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

Properties4

keywordLocation

readonly
readonly string $keywordLocation
Type
string

message

readonly
readonly string $message
Type
string

path

readonly
readonly string $path
Type
string

validator

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

Methods3

jsonSerialize()

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

__construct($validator, $keywordLocation, $message, $path)

Validator.php:17
function __construct( ?MMO\core\schemas\Validator $validator, string $keywordLocation, string $message, string $path = '' )
$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).
$path = ''stringfor an error with no validator, where in the value it is: 1/uid when an item of a list could not be converted ('' for the value itself). An error of a validator has its path (Validator::getPath).

__toString()

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