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