ClubTeam   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 24
c 1
b 0
f 0
dl 0
loc 58
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getCategory() 0 3 1
A getClubId() 0 3 1
A createFromResponse() 0 13 1
A getId() 0 3 1
A getShirtColor() 0 3 1
A getGroups() 0 3 1
A getShirtReserveColor() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Eekes\VblApi\Entity;
5
6
class ClubTeam
7
{
8
    private string $id;
9
    private ?string $name;
10
    private ?string $category;
11
    private ?string $clubId;
12
    private ?string $shirtColor;
13
    private ?string $shirtReserveColor;
14
    private ClubTeamGroupCollection $groups;
15
16
    public static function createFromResponse(\stdClass $response): self
17
    {
18
        $team = new self();
19
20
        $team->id = $response->guid;
21
        $team->name = $response->naam;
22
        $team->category = $response->categorie;
23
        $team->clubId = $response->organisationGUID;
24
        $team->shirtColor = $response->shirtKleur;
25
        $team->shirtReserveColor = $response->shirtReserve;
26
        $team->groups = ClubTeamGroupCollection::createFromArrayResponse($response->poules);
27
28
        return $team;
29
    }
30
31
    public function getId(): string
32
    {
33
        return $this->id;
34
    }
35
36
    public function getName(): ?string
37
    {
38
        return $this->name;
39
    }
40
41
    public function getCategory(): ?string
42
    {
43
        return $this->category;
44
    }
45
46
    public function getClubId(): ?string
47
    {
48
        return $this->clubId;
49
    }
50
51
    public function getShirtColor(): ?string
52
    {
53
        return $this->shirtColor;
54
    }
55
56
    public function getShirtReserveColor(): ?string
57
    {
58
        return $this->shirtReserveColor;
59
    }
60
61
    public function getGroups(): ClubTeamGroupCollection
62
    {
63
        return $this->groups;
64
    }
65
}