Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class User |
||
10 | { |
||
11 | private $id; |
||
12 | private $name; |
||
13 | private $username; |
||
14 | private $data; |
||
15 | |||
16 | 32 | public function __construct(string $id, string $name = null, string $username = null, array $data = []) |
|
17 | { |
||
18 | 32 | $this->id = $id; |
|
19 | 32 | $this->name = $name; |
|
20 | 32 | $this->username = $username; |
|
21 | 32 | $this->data = collect($data); |
|
22 | 32 | } |
|
23 | |||
24 | 4 | public function getId(): string |
|
25 | { |
||
26 | 4 | return $this->id; |
|
27 | } |
||
28 | |||
29 | 2 | public function getName(): ?string |
|
30 | { |
||
31 | 2 | return $this->name; |
|
32 | } |
||
33 | |||
34 | 2 | public function getUsername(): ?string |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * Additional user information. |
||
41 | * |
||
42 | * @return Collection |
||
43 | */ |
||
44 | 1 | public function getData(): Collection |
|
47 | } |
||
48 | } |
||
49 |