1: | <?php |
2: | |
3: | namespace IPay\ValueObjects; |
4: | |
5: | use EventSauce\ObjectHydrator\Constructor; |
6: | |
7: | readonly class Account |
8: | { |
9: | private function __construct( |
10: | public string $title, |
11: | public string $number, |
12: | public string $currencyCode, |
13: | public AccountState $accountState, |
14: | ) { |
15: | } |
16: | |
17: | #[Constructor] |
18: | public static function create( |
19: | string $title, |
20: | string $number, |
21: | string $currencyCode, |
22: | AccountState $accountState, |
23: | ): self { |
24: | return new self( |
25: | $title, |
26: | $number, |
27: | $currencyCode, |
28: | $accountState, |
29: | ); |
30: | } |
31: | } |
32: | |