Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
18 | final class EmailField |
||
19 | { |
||
20 | private string $email; |
||
21 | |||
22 | public function __construct(string $email) |
||
23 | { |
||
24 | if (!\filter_var($email, \FILTER_VALIDATE_EMAIL)) { |
||
25 | throw new InvalidEmail(); |
||
26 | } |
||
27 | $this->email = $email; |
||
28 | } |
||
29 | |||
30 | public static function fromString(string $email): self |
||
33 | } |
||
34 | |||
35 | public function getValue(): string |
||
40 |