ValidatorRequired
in package
implements
ValidatorInterface
Example config: 'expires' => ['required'] or 'expires' => ['required' => true] or required only on certain operation types 'expires' => ['required' => ['create', 'update']]
Table of Contents
Interfaces
Properties
- $name : string
Methods
- normaliseConfigValue() : mixed
- Normalises the config value for this validator
- validate() : array<string|int, mixed>|bool
- Validates the key and it's value based on the config.
Properties
$name
private
string
$name
= 'required'
Methods
normaliseConfigValue()
Normalises the config value for this validator
public
normaliseConfigValue(array<string|int, mixed> $config[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $config : array<string|int, mixed>
- $options : array<string|int, mixed> = []
validate()
Validates the key and it's value based on the config.
public
validate(string $key, mixed $value, array<string|int, mixed> $config, array<string|int, mixed> $data[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>|bool
Parameters
- $key : string
- $value : mixed
- $config : array<string|int, mixed>
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = []