From 700ffec5ab69de38539d6c0ffd019146ac19737f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 28 May 2016 21:29:37 -0400 Subject: Rename base validator class --- app/Validator/BaseValidator.php | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 app/Validator/BaseValidator.php (limited to 'app/Validator/BaseValidator.php') diff --git a/app/Validator/BaseValidator.php b/app/Validator/BaseValidator.php new file mode 100644 index 00000000..6088538c --- /dev/null +++ b/app/Validator/BaseValidator.php @@ -0,0 +1,55 @@ +$method($values); + + if (! $result) { + break; + } + } + + return array($result, $errors); + } + + /** + * Common password validation rules + * + * @access protected + * @return array + */ + protected function commonPasswordValidationRules() + { + return array( + new Validators\Required('password', t('The password is required')), + new Validators\MinLength('password', t('The minimum length is %d characters', 6), 6), + new Validators\Required('confirmation', t('The confirmation is required')), + new Validators\Equals('password', 'confirmation', t('Passwords don\'t match')), + ); + } +} -- cgit v1.2.3