Team   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 18
c 1
b 0
f 0
dl 0
loc 44
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getPlayers() 0 3 1
A getGroups() 0 3 1
A getStaff() 0 3 1
A createFromResponse() 0 11 1
A getId() 0 3 1
A getName() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Eekes\VblApi\Entity;
5
6
class Team
7
{
8
    private string $id;
9
    private string $name;
10
    private GroupCollection $groups;
11
    private PlayerCollection $players;
12
    private StaffCollection $staff;
13
14
    public static function createFromResponse(\stdClass $response): self
15
    {
16
        $team = new self();
17
18
        $team->id = $response->guid;
19
        $team->name = $response->naam;
20
        $team->groups = GroupCollection::createFromArrayResponse($response->poules);
21
        $team->players = PlayerCollection::createFromArrayResponse($response->spelers ?? []);
22
        $team->staff = StaffCollection::createFromArrayResponse($response->tvlijst ?? []);
23
24
        return $team;
25
    }
26
27
    public function getId(): string
28
    {
29
        return $this->id;
30
    }
31
32
    public function getName(): string
33
    {
34
        return $this->name;
35
    }
36
37
    public function getGroups(): GroupCollection
38
    {
39
        return $this->groups;
40
    }
41
42
    public function getPlayers(): PlayerCollection
43
    {
44
        return $this->players;
45
    }
46
47
    public function getStaff(): StaffCollection
48
    {
49
        return $this->staff;
50
    }
51
}