final class Message

Represents a single validation error or warning with a message template, error code, path, and variables.

Constants

TypeMismatch

variables: {value: mixed, expected: string}

ValueOutOfRange

variables: {value: mixed, expected: string}

LengthOutOfRange

variables: {value: mixed, length: int, expected: string}

PatternMismatch

variables: {value: string, pattern: string}

FailedAssertion

variables: {value: mixed, assertion: string}

MissingItem

no variables

UnexpectedItem

variables: {hint: string}

Deprecated

no variables

TYPE_MISMATCH

VALUE_OUT_OF_RANGE

LENGTH_OUT_OF_RANGE

PATTERN_MISMATCH

FAILED_ASSERTION

MISSING_ITEM

UNEXPECTED_ITEM

DEPRECATED

Methods

__construct(string $message, string $code, array $path, array $variables = [])

No description

string
toString()

Formats the message template by substituting %variable% placeholders with their values.

Details

at line 67
__construct(string $message, string $code, array $path, array $variables = [])

No description

Parameters

string $message
string $code
array $path
array $variables

at line 81
string toString()

Formats the message template by substituting %variable% placeholders with their values.

Return Value

string