| 1 | <?php |
||
| 9 | final class User implements JsonSerializable |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string|int|null |
||
| 13 | */ |
||
| 14 | private $id; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string|null |
||
| 18 | */ |
||
| 19 | private $email; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $username; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string|int $id |
||
| 28 | */ |
||
| 29 | 2 | public function withId($id): self |
|
| 36 | |||
| 37 | 1 | public function withEmail(string $email): self |
|
| 44 | |||
| 45 | 1 | public function withUsername(string $username): self |
|
| 52 | |||
| 53 | /** |
||
| 54 | * @return mixed[] |
||
| 55 | */ |
||
| 56 | 3 | public function jsonSerialize(): array |
|
| 64 | } |
||
| 65 |