validator_interface
Contract for request validation rules.
Table of Contents
Methods
- get_errors() : array<string, string>
- Get the validation errors.
- validate() : bool
- Validate the given data.
Methods
get_errors()
Get the validation errors.
public
get_errors() : array<string, string>
Return values
array<string, string> —field => error message
validate()
Validate the given data.
public
validate(array<string|int, mixed> $data) : bool
Parameters
- $data : array<string|int, mixed>
-
Input data (usually from $_POST or $_GET)
Tags
Return values
bool —True if valid