summaryrefslogtreecommitdiff
path: root/app/Validator
diff options
context:
space:
mode:
Diffstat (limited to 'app/Validator')
-rw-r--r--app/Validator/PredefinedTaskDescriptionValidator.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/Validator/PredefinedTaskDescriptionValidator.php b/app/Validator/PredefinedTaskDescriptionValidator.php
new file mode 100644
index 00000000..3ff4e3cb
--- /dev/null
+++ b/app/Validator/PredefinedTaskDescriptionValidator.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Kanboard\Validator;
+
+use SimpleValidator\Validator;
+use SimpleValidator\Validators;
+
+class PredefinedTaskDescriptionValidator extends BaseValidator
+{
+ public function validate(array $values)
+ {
+ $v = new Validator($values, array(
+ new Validators\Required('title', t('This value is required')),
+ new Validators\Required('description', t('This value is required')),
+ ));
+
+ return array(
+ $v->execute(),
+ $v->getErrors()
+ );
+ }
+} \ No newline at end of file