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