| Total Complexity | 2 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class RegexpRule extends AbstractRule |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string error template |
||
| 23 | */ |
||
| 24 | protected $description = 'must validate with regular expression rule'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string regular expression for check string |
||
| 28 | */ |
||
| 29 | protected $regexp; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Check string by regular expression |
||
| 33 | * |
||
| 34 | * @param string $regexp |
||
| 35 | */ |
||
| 36 | 5 | public function __construct(string $regexp) |
|
| 39 | 5 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Check string by regular expression |
||
| 43 | * |
||
| 44 | * @param mixed $input |
||
| 45 | * |
||
| 46 | * @return bool |
||
| 47 | */ |
||
| 48 | 4 | public function validate($input): bool |
|
| 53 |