Completed
Branch master (bc6362)
by Jürg
01:56
created

AbstractRegexValidator::getPattern()

Size

Total Lines 1

Duplication

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