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/ActionValidator.php | 4 +-- app/Validator/AuthValidator.php | 4 +-- app/Validator/Base.php | 54 ------------------------------- app/Validator/BaseValidator.php | 55 ++++++++++++++++++++++++++++++++ app/Validator/CategoryValidator.php | 4 +-- app/Validator/ColumnValidator.php | 4 +-- app/Validator/CommentValidator.php | 4 +-- app/Validator/CurrencyValidator.php | 4 +-- app/Validator/CustomFilterValidator.php | 4 +-- app/Validator/ExternalLinkValidator.php | 4 +-- app/Validator/GroupValidator.php | 4 +-- app/Validator/LinkValidator.php | 4 +-- app/Validator/PasswordResetValidator.php | 6 ++-- app/Validator/ProjectValidator.php | 4 +-- app/Validator/SubtaskValidator.php | 4 +-- app/Validator/SwimlaneValidator.php | 4 +-- app/Validator/TaskLinkValidator.php | 4 +-- app/Validator/TaskValidator.php | 4 +-- app/Validator/UserValidator.php | 4 +-- 19 files changed, 90 insertions(+), 89 deletions(-) delete mode 100644 app/Validator/Base.php create mode 100644 app/Validator/BaseValidator.php diff --git a/app/Validator/ActionValidator.php b/app/Validator/ActionValidator.php index 95ee7d21..4ce5db46 100644 --- a/app/Validator/ActionValidator.php +++ b/app/Validator/ActionValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Action Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ActionValidator extends Base +class ActionValidator extends BaseValidator { /** * Validate action creation diff --git a/app/Validator/AuthValidator.php b/app/Validator/AuthValidator.php index 14d66ee4..03ff6f22 100644 --- a/app/Validator/AuthValidator.php +++ b/app/Validator/AuthValidator.php @@ -9,10 +9,10 @@ use Gregwar\Captcha\CaptchaBuilder; /** * Authentication Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class AuthValidator extends Base +class AuthValidator extends BaseValidator { /** * Validate user login form 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 @@ -$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')), - ); - } -} 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')), + ); + } +} diff --git a/app/Validator/CategoryValidator.php b/app/Validator/CategoryValidator.php index 715aed66..fc42d2e5 100644 --- a/app/Validator/CategoryValidator.php +++ b/app/Validator/CategoryValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Category Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CategoryValidator extends Base +class CategoryValidator extends BaseValidator { /** * Validate category creation diff --git a/app/Validator/ColumnValidator.php b/app/Validator/ColumnValidator.php index f0f1659b..25aa45d0 100644 --- a/app/Validator/ColumnValidator.php +++ b/app/Validator/ColumnValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Column Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ColumnValidator extends Base +class ColumnValidator extends BaseValidator { /** * Validate column modification diff --git a/app/Validator/CommentValidator.php b/app/Validator/CommentValidator.php index 4eb54206..fc8e6da8 100644 --- a/app/Validator/CommentValidator.php +++ b/app/Validator/CommentValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Comment Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CommentValidator extends Base +class CommentValidator extends BaseValidator { /** * Validate comment creation diff --git a/app/Validator/CurrencyValidator.php b/app/Validator/CurrencyValidator.php index ee191523..4f375c54 100644 --- a/app/Validator/CurrencyValidator.php +++ b/app/Validator/CurrencyValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Currency Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CurrencyValidator extends Base +class CurrencyValidator extends BaseValidator { /** * Validate diff --git a/app/Validator/CustomFilterValidator.php b/app/Validator/CustomFilterValidator.php index 07f2a1eb..1ab9303d 100644 --- a/app/Validator/CustomFilterValidator.php +++ b/app/Validator/CustomFilterValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Custom Filter Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CustomFilterValidator extends Base +class CustomFilterValidator extends BaseValidator { /** * Common validation rules diff --git a/app/Validator/ExternalLinkValidator.php b/app/Validator/ExternalLinkValidator.php index fff4133b..9c017708 100644 --- a/app/Validator/ExternalLinkValidator.php +++ b/app/Validator/ExternalLinkValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * External Link Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ExternalLinkValidator extends Base +class ExternalLinkValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/GroupValidator.php b/app/Validator/GroupValidator.php index 2946ca23..8b21c697 100644 --- a/app/Validator/GroupValidator.php +++ b/app/Validator/GroupValidator.php @@ -9,10 +9,10 @@ use Kanboard\Model\GroupModel; /** * Group Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class GroupValidator extends Base +class GroupValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/LinkValidator.php b/app/Validator/LinkValidator.php index 2a9967a2..8e1c8780 100644 --- a/app/Validator/LinkValidator.php +++ b/app/Validator/LinkValidator.php @@ -9,10 +9,10 @@ use Kanboard\Model\LinkModel; /** * Link Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class LinkValidator extends Base +class LinkValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/PasswordResetValidator.php b/app/Validator/PasswordResetValidator.php index baf2d8d7..e44e5206 100644 --- a/app/Validator/PasswordResetValidator.php +++ b/app/Validator/PasswordResetValidator.php @@ -9,10 +9,10 @@ use Gregwar\Captcha\CaptchaBuilder; /** * Password Reset Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class PasswordResetValidator extends Base +class PasswordResetValidator extends BaseValidator { /** * Validate creation @@ -87,6 +87,6 @@ class PasswordResetValidator extends Base } } - return array($result, $errors);; + return array($result, $errors); } } diff --git a/app/Validator/ProjectValidator.php b/app/Validator/ProjectValidator.php index b1406a2f..9ef59111 100644 --- a/app/Validator/ProjectValidator.php +++ b/app/Validator/ProjectValidator.php @@ -9,10 +9,10 @@ use Kanboard\Model\ProjectModel; /** * Project Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ProjectValidator extends Base +class ProjectValidator extends BaseValidator { /** * Common validation rules diff --git a/app/Validator/SubtaskValidator.php b/app/Validator/SubtaskValidator.php index 1989b7f4..b80de41d 100644 --- a/app/Validator/SubtaskValidator.php +++ b/app/Validator/SubtaskValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Subtask Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class SubtaskValidator extends Base +class SubtaskValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/SwimlaneValidator.php b/app/Validator/SwimlaneValidator.php index 4cc780f9..16f8bfba 100644 --- a/app/Validator/SwimlaneValidator.php +++ b/app/Validator/SwimlaneValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Swimlane Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class SwimlaneValidator extends Base +class SwimlaneValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/TaskLinkValidator.php b/app/Validator/TaskLinkValidator.php index 1c167e4c..6da257bf 100644 --- a/app/Validator/TaskLinkValidator.php +++ b/app/Validator/TaskLinkValidator.php @@ -9,10 +9,10 @@ use Kanboard\Model\TaskModel; /** * Task Link Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class TaskLinkValidator extends Base +class TaskLinkValidator extends BaseValidator { /** * Common validation rules diff --git a/app/Validator/TaskValidator.php b/app/Validator/TaskValidator.php index 55ea8fdd..7c39ff51 100644 --- a/app/Validator/TaskValidator.php +++ b/app/Validator/TaskValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Task Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class TaskValidator extends Base +class TaskValidator extends BaseValidator { /** * Common validation rules diff --git a/app/Validator/UserValidator.php b/app/Validator/UserValidator.php index 1a24f23e..9911de50 100644 --- a/app/Validator/UserValidator.php +++ b/app/Validator/UserValidator.php @@ -9,10 +9,10 @@ use Kanboard\Model\UserModel; /** * User Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class UserValidator extends Base +class UserValidator extends BaseValidator { /** * Common validation rules -- cgit v1.2.3