class ValidationException extends RuntimeException

Validation exception.

Properties

protected array $errors Validation errors.
protected array $meta Exception meta.

Methods

__construct(array $errors, string $message = '', int $code = 0, Throwable|null $previous = null)

Constructor.

array
getErrors()

Returns the validation errors.

string
getMessageWithErrors()

Returns the exception message along with the validation errors.

addMeta(string $key, mixed $value)

Adds meta.

mixed
getMeta(string $key, mixed $default = null)

Gets meta.

Details

at line 49
__construct(array $errors, string $message = '', int $code = 0, Throwable|null $previous = null)

Constructor.

Parameters

array $errors Validation errors
string $message Exception code
int $code Exception message
Throwable|null $previous Previous exception

at line 61
array getErrors()

Returns the validation errors.

Return Value

array

at line 71
string getMessageWithErrors()

Returns the exception message along with the validation errors.

Return Value

string

at line 89
addMeta(string $key, mixed $value)

Adds meta.

Parameters

string $key Meta key
mixed $value Meta value

at line 101
mixed getMeta(string $key, mixed $default = null)

Gets meta.

Parameters

string $key Meta key
mixed $default Default return value

Return Value

mixed