PHP Class Bluz\Validator\ValidatorBuilder

Author: Anton Shevchuk
显示文件 Open project: bluzphp/framework Class Usage Examples

Protected Properties

Property Type Description
$errors list of validation errors
$validators array ['foo'] => [Validator, ...] ['bar'] => [Validator, ...]

Public Methods

Method Description
add ( string $name, $validators ) : ValidatorBuilder Add validator to builder
assert ( mixed $input ) : boolean Assert
getErrors ( ) : array Get errors
validate ( array | object $input ) : boolean Validate chain of rules
validateItem ( string $key, array | object $input ) : boolean Validate chain of rules for single item

Method Details

add() public method

Add validator to builder
public add ( string $name, $validators ) : ValidatorBuilder
$name string
$validators
return ValidatorBuilder

assert() public method

Assert
public assert ( mixed $input ) : boolean
$input mixed
return boolean

getErrors() public method

Get errors
public getErrors ( ) : array
return array

validate() public method

Validate chain of rules
public validate ( array | object $input ) : boolean
$input array | object
return boolean

validateItem() public method

Validate chain of rules for single item
public validateItem ( string $key, array | object $input ) : boolean
$key string
$input array | object
return boolean

Property Details

$errors protected_oe property

list of validation errors
protected $errors

$validators protected_oe property

['foo'] => [Validator, ...] ['bar'] => [Validator, ...]
protected array $validators
return array