Passed
Push — master ( 1b31ec...bd8224 )
by Mattia
10:45 queued 05:36
created

MojangAccount::getSkin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
A parse error occurred: Syntax error, unexpected T_READONLY on line 12 at column 0
Loading history...
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