diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-28 21:29:37 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-28 21:29:37 -0400 |
commit | 700ffec5ab69de38539d6c0ffd019146ac19737f (patch) | |
tree | b985ec33cfc84307e9eb8d80d667d372b2094b45 /app/Validator/Base.php | |
parent | ed074d176406ca3ce5ba8fa6e0c4511f729efa5b (diff) |
Rename base validator class
Diffstat (limited to 'app/Validator/Base.php')
-rw-r--r-- | app/Validator/Base.php | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/app/Validator/Base.php b/app/Validator/Base.php deleted file mode 100644 index ba32a503..00000000 --- a/app/Validator/Base.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Kanboard\Validator; - -use SimpleValidator\Validators; - -/** - * Base Validator - * - * @package validator - * @author Frederic Guillot - */ -class Base extends \Kanboard\Core\Base -{ - /** - * Execute multiple validators - * - * @access public - * @param array $validators List of validators - * @param array $values Form values - * @return array $valid, $errors [0] = Success or not, [1] = List of errors - */ - public function executeValidators(array $validators, array $values) - { - $result = false; - $errors = array(); - - foreach ($validators as $method) { - list($result, $errors) = $this->$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')), - ); - } -} |