1 | <?php |
||
9 | class User |
||
10 | { |
||
11 | private $id; |
||
12 | private $name; |
||
13 | private $username; |
||
14 | private $data; |
||
15 | |||
16 | 31 | public function __construct(string $id, string $name = null, string $username = null, array $data = []) |
|
23 | |||
24 | 3 | public static function create(string $id, string $name = null, string $username = null, array $data = []) |
|
25 | { |
||
26 | 3 | return new static($id, $name, $username, $data); |
|
27 | } |
||
28 | |||
29 | 4 | public function getId(): string |
|
33 | |||
34 | 2 | public function getName(): ?string |
|
38 | |||
39 | 2 | public function getUsername(): ?string |
|
43 | |||
44 | /** |
||
45 | * Additional user information. |
||
46 | * |
||
47 | * @return Collection |
||
48 | */ |
||
49 | 1 | public function getData(): Collection |
|
53 | } |
||
54 |