Total Complexity | 5 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
10 | class Cep extends AbstractRule |
||
11 | { |
||
12 | const MASK = '/^[0-9]{5}\-[0-9]{3}$/'; |
||
13 | const UNMASK = '/^[0-9]{8}$/'; |
||
14 | |||
15 | public function __construct(private bool $mask = true, ?string $message = 'CEP inválido') |
||
18 | } |
||
19 | |||
20 | protected function evaluate(mixed $input, array $context = []): bool |
||
30 |