1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Minepic\Minecraft; |
||
6 | |||
7 | use Illuminate\Contracts\Support\Arrayable; |
||
8 | |||
9 | /** |
||
10 | * @implements Arrayable<string, null|string> |
||
11 | */ |
||
12 | readonly class MojangAccount implements Arrayable |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
13 | { |
||
14 | public function __construct( |
||
15 | private string $uuid, |
||
16 | private string $username, |
||
17 | private string $skin = '', |
||
18 | private string $cape = '' |
||
19 | ) { |
||
20 | } |
||
21 | |||
22 | public function getUuid(): string |
||
23 | { |
||
24 | return $this->uuid; |
||
25 | } |
||
26 | |||
27 | public function getUsername(): string |
||
28 | { |
||
29 | return $this->username; |
||
30 | } |
||
31 | |||
32 | public function getSkin(): ?string |
||
33 | { |
||
34 | return $this->skin; |
||
35 | } |
||
36 | |||
37 | public function getCape(): ?string |
||
38 | { |
||
39 | return $this->cape; |
||
40 | } |
||
41 | |||
42 | public function toArray(): array |
||
43 | { |
||
44 | return [ |
||
45 | 'uuid' => $this->uuid, |
||
46 | 'username' => $this->username, |
||
47 | 'skin' => $this->skin, |
||
48 | 'cape' => $this->cape, |
||
49 | ]; |
||
50 | } |
||
51 | } |
||
52 |