Ivan - Implement respect/validation for validation
This commit is contained in:
parent
265b0c9bc2
commit
19638d27c8
|
@ -21,7 +21,7 @@ class CreateController extends Controller {
|
|||
'content' => [
|
||||
'validation' => DataValidator::length(10, 500),
|
||||
'error' => ERRORS::INVALID_CONTENT
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
require_once 'validators/Validator.php';
|
||||
require_once 'validators/EmailValidator.php';
|
||||
require_once 'validators/PasswordValidator.php';
|
||||
|
||||
class ValidatorFactory {
|
||||
public static function getValidator($validatorName) {
|
||||
switch ($validatorName) {
|
||||
case 'email':
|
||||
return new EmailValidator();
|
||||
case 'password':
|
||||
return new PasswordValidator();
|
||||
default:
|
||||
return new Validator();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue