Total Complexity | 7 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
10 | class Cnpj extends AbstractRule |
||
11 | { |
||
12 | const MASK = '/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/'; |
||
13 | const LENGTH = 14; |
||
14 | |||
15 | public function __construct(private bool $mask = true, ?string $message = 'CNPJ inválido') |
||
16 | { |
||
17 | parent::__construct($message); |
||
18 | } |
||
19 | |||
20 | protected function evaluate(mixed $input, array $context = []): bool |
||
41 | } |
||
42 | } |
||
43 |