AbstractRegexValidator::getPattern()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
nc 1
1
<?php
2
3
namespace Jgxvx\Common\Validator;
4
5
abstract class AbstractRegexValidator implements StringValidator
6
{
7
8 14
    public function isValid(string $value) : bool
9
    {
10 14
        return preg_match($this->getPattern(), $value) === 1;
11
    }
12
13
    abstract protected function getPattern() : string;
14
}
15