1 | <?php |
||
14 | final class User |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $name; |
||
20 | |||
21 | /** |
||
22 | * @var string|null |
||
23 | */ |
||
24 | private $country; |
||
25 | |||
26 | /** |
||
27 | * @var int|null |
||
28 | */ |
||
29 | private $age; |
||
30 | |||
31 | /** |
||
32 | * @var string|null |
||
33 | */ |
||
34 | private $gender; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | private $playcount; |
||
40 | |||
41 | /** |
||
42 | * @var string|null |
||
43 | */ |
||
44 | private $url; |
||
45 | |||
46 | /** |
||
47 | * User constructor. |
||
48 | * |
||
49 | * @param string $name |
||
50 | * @param null|string $country |
||
51 | * @param int|null $age |
||
52 | * @param null|string $gender |
||
53 | * @param int $playcount |
||
54 | * @param null|string $url |
||
55 | */ |
||
56 | public function __construct( |
||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getName(): string |
||
79 | |||
80 | /** |
||
81 | * @return null|string |
||
82 | */ |
||
83 | public function getCountry(): ?string |
||
87 | |||
88 | /** |
||
89 | * @return int|null |
||
90 | */ |
||
91 | public function getAge(): ?int |
||
95 | |||
96 | /** |
||
97 | * @return null|string |
||
98 | */ |
||
99 | public function getGender(): ?string |
||
103 | |||
104 | /** |
||
105 | * @return int |
||
106 | */ |
||
107 | public function getPlaycount(): int |
||
111 | |||
112 | /** |
||
113 | * @return null|string |
||
114 | */ |
||
115 | public function getUrl(): ?string |
||
119 | |||
120 | /** |
||
121 | * @param array $data |
||
122 | * |
||
123 | * @return User |
||
124 | */ |
||
125 | public static function fromApi(array $data): self |
||
136 | } |
||
137 |