Total Complexity | 3 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
10 | class PregMatch extends AbstractValidation |
||
11 | { |
||
12 | public function __construct(private string $pattern, ?string $message = null) |
||
13 | { |
||
14 | parent::__construct($message ?? sprintf('Value does not match pattern: %s', $this->pattern)); |
||
15 | } |
||
16 | |||
17 | protected function isValid($input, array $context = []): bool |
||
26 | } |
||
27 | } |
||
28 |