1 | <?php |
||
7 | final class Email implements ValueObjectInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private const NIL = ""; |
||
13 | |||
14 | /** |
||
15 | * @var Text |
||
16 | */ |
||
17 | private $localPart; |
||
18 | |||
19 | /** |
||
20 | * @var Text |
||
21 | */ |
||
22 | private $domain; |
||
23 | |||
24 | /** |
||
25 | * @param string|null $nativeValue |
||
26 | * @return self |
||
27 | */ |
||
28 | 18 | public static function fromNative($nativeValue): self |
|
38 | |||
39 | 4 | public function toNative(): string |
|
46 | |||
47 | 1 | public function equals(ValueObjectInterface $otherValue): bool |
|
51 | |||
52 | 1 | public function __toString(): string |
|
56 | |||
57 | 1 | public function getLocalPart(): Text |
|
61 | |||
62 | 1 | public function getDomain(): Text |
|
66 | |||
67 | 18 | private function __construct(Text $localPart, Text $domain) |
|
72 | } |
||
73 |