Total Complexity | 3 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | #[Attribute] |
||
10 | class Email implements Rule |
||
11 | { |
||
12 | /** @return Type[] */ |
||
13 | 1 | public function applicableToTypes(): array |
|
14 | { |
||
15 | 1 | return [Type::string]; |
|
16 | } |
||
17 | |||
18 | /** @param string $value */ |
||
19 | 1 | public function isValid(mixed $value): bool |
|
20 | { |
||
21 | 1 | return filter_var($value, FILTER_VALIDATE_EMAIL) !== false; |
|
22 | } |
||
23 | |||
24 | 1 | public function getMessage(): string |
|
27 | } |
||
28 | } |
||
29 |