Passed
Push — master ( bbc85b...f0bc06 )
by
04:59
created

ProfileResponse::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Ely\Mojang\Response;
5
6
use Ely\Mojang\Response\Properties\Factory;
7
8
class ProfileResponse {
9
10
    /**
11
     * @var string
12
     */
13
    private $id;
14
15
    /**
16
     * @var string
17
     */
18
    private $name;
19
20
    /**
21
     * @var array
22
     */
23
    private $props;
24
25 3
    public function __construct(string $id, string $name, array $rawProps) {
26 3
        $this->id = $id;
27 3
        $this->name = $name;
28 3
        $this->props = $rawProps;
29 3
    }
30
31 2
    public function getId(): string {
32 2
        return $this->id;
33
    }
34
35 2
    public function getName(): string {
36 2
        return $this->name;
37
    }
38
39
    /**
40
     * @return \Ely\Mojang\Response\Properties\Property[]
41
     */
42 2
    public function getProps(): array {
43 2
        return array_map([Factory::class, 'createFromProp'], $this->props);
44
    }
45
46
}
47