AuthenticationResponseUserField   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
ccs 8
cts 8
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getProperties() 0 2 1
A __construct() 0 3 1
A getId() 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 AuthenticationResponseUserField {
9
10
    private $id;
11
12
    private $rawProperties;
13
14 2
    public function __construct(string $id, array $rawProperties) {
15 2
        $this->id = $id;
16 2
        $this->rawProperties = $rawProperties;
17 2
    }
18
19 2
    public function getId(): string {
20 2
        return $this->id;
21
    }
22
23
    /**
24
     * @return \Ely\Mojang\Response\Properties\Property[]
25
     */
26 2
    public function getProperties(): array {
27 2
        return array_map([Factory::class, 'createFromProp'], $this->rawProperties);
28
    }
29
30
}
31