A validator that works
Breifly, a PHP validator that is:
- Standalone
- Works independenltly for data, as well as files.
- Flexible.
if($errors = ItvisionSy\Validator\RequiredValidatorRule::quick('99')===true){
// validator succeeded
} else {
// failed
var_dump($errors);
}
if($errors = ItvisionSy\Validator\ValidatorItem::quick(99,'required')===true){
// succeeded
} else {
// failed
var_dump($errors);
}
if($errors = ItvisionSy\Validator\Validator::quick([
'name'=>'required|string|min:4',
'email'=>'required|email'
],[
'name'=>'Muhannad Shelleh'
])===true){
// succeeded
} else {
// failed (like now)
var_dump($errors);
}