summaryrefslogtreecommitdiff
path: root/libs/SimpleValidator/Validators/AlphaNumeric.php
blob: 8d5000b483c8f655037287f2d2e3f8f9032f7243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
    }
}