class Validator

Properties

static protected Array $rules Definition of the validation rules.

Methods

static  Array
getRules()

Retrieve the rules of this validator.

static  Array
validate( array $input, Mixed $rules = null, Bool $only_present = false)

Validate the input using $rules.

Details

at line line 36
static Array getRules()

Retrieve the rules of this validator.

Return Value

Array

at line line 52
static Array validate( array $input, Mixed $rules = null, Bool $only_present = false)

Validate the input using $rules.

Drop any keys that are not present in $rules.

Parameters

array $input
Mixed $rules (optional) Override internal rules
Bool $only_present Whether to only validate fields present in $input (default = false)

Return Value

Array

Exceptions

InvalidInput