| Total Complexity | 9 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 77.78% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class MatchRegularExpression extends Rule |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var string the regular expression to be matched with |
||
| 20 | */ |
||
| 21 | private string $pattern; |
||
| 22 | /** |
||
| 23 | * @var bool whether to invert the validation logic. Defaults to false. If set to true, |
||
| 24 | * the regular expression defined via [[pattern]] should NOT match the attribute value. |
||
| 25 | */ |
||
| 26 | private bool $not = false; |
||
| 27 | |||
| 28 | private string $message = 'Value is invalid.'; |
||
| 29 | |||
| 30 | 1 | public function __construct(string $pattern) |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | protected function validateValue($value, DataSetInterface $dataSet = null): Result |
|
| 48 | } |
||
| 49 | |||
| 50 | 1 | public function not(): self |
|
| 55 | } |
||
| 56 | |||
| 57 | public function message(string $message): self |
||
| 64 |