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

ProfileResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 36
ccs 11
cts 11
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 2 1
A getId() 0 2 1
A getProps() 0 2 1
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