summaryrefslogtreecommitdiff
path: root/libs/SimpleValidator/Validators/AlphaNumeric.php
diff options
context:
space:
mode:
Diffstat (limited to 'libs/SimpleValidator/Validators/AlphaNumeric.php')
-rw-r--r--libs/SimpleValidator/Validators/AlphaNumeric.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/SimpleValidator/Validators/AlphaNumeric.php b/libs/SimpleValidator/Validators/AlphaNumeric.php
new file mode 100644
index 00000000..8d5000b4
--- /dev/null
+++ b/libs/SimpleValidator/Validators/AlphaNumeric.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace SimpleValidator\Validators;
+
+class AlphaNumeric extends Base
+{
+ public function execute(array $data)
+ {
+ if ($this->isFieldNotEmpty($data)) {
+ return ctype_alnum($data[$this->field]);
+ }
+
+ return true;
+ }
+}