1 | <?php |
||
19 | final class InverseFunctionalIdentifier |
||
20 | { |
||
21 | private $mbox; |
||
22 | private $mboxSha1Sum; |
||
23 | private $openId; |
||
24 | private $account; |
||
25 | |||
26 | /** |
||
27 | * Use one of the with*() factory methods to obtain an InverseFunctionalIdentifier |
||
28 | * instance. |
||
29 | */ |
||
30 | private function __construct() |
||
33 | |||
34 | public static function withMbox(IRI $mbox): self |
||
41 | |||
42 | public static function withMboxSha1Sum(string $mboxSha1Sum): self |
||
49 | 10 | ||
50 | public static function withOpenId(string $openId): self |
||
57 | 6 | ||
58 | public static function withAccount(Account $account): self |
||
65 | |||
66 | /** |
||
67 | * Returns the mailto IRI. |
||
68 | */ |
||
69 | public function getMbox(): ?IRI |
||
73 | 3 | ||
74 | /** |
||
75 | 3 | * Returns the SHA1 hash of a mailto IRI. |
|
76 | 3 | */ |
|
77 | public function getMboxSha1Sum(): ?string |
||
81 | |||
82 | /** |
||
83 | * Returns the openID. |
||
84 | */ |
||
85 | public function getOpenId(): ?string |
||
89 | |||
90 | /** |
||
91 | * Returns the user account of an existing system. |
||
92 | */ |
||
93 | public function getAccount(): ?Account |
||
97 | |||
98 | /** |
||
99 | * Checks if another IRI is equal. |
||
100 | * |
||
101 | * Two inverse functional identifiers are equal if and only if all of their |
||
102 | * properties are equal. |
||
103 | */ |
||
104 | public function equals(InverseFunctionalIdentifier $iri): bool |
||
132 | |||
133 | 19 | public function __toString(): string |
|
149 | } |
||
150 |