GroupTeam   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 13
eloc 39
c 1
b 0
f 0
dl 0
loc 93
rs 10

13 Methods

Rating   Name   Duplication   Size   Complexity  
A getGamesLost() 0 3 1
A getPointsAgainst() 0 3 1
A getId() 0 3 1
A getGamesWon() 0 3 1
A getRankingPoints() 0 3 1
A getGamesDrawn() 0 3 1
A getGamesForfeited() 0 3 1
A getGamesPlayed() 0 3 1
A createFromResponse() 0 18 1
A getRank() 0 3 1
A getName() 0 3 1
A getRemarks() 0 3 1
A getPointsMade() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Eekes\VblApi\Entity;
5
6
class GroupTeam
7
{
8
    private string $id;
9
    private string $name;
10
    private int $rank = 0;
11
    private int $gamesPlayed = 0;
12
    private int $rankingPoints = 0;
13
    private int $pointsMade = 0;
14
    private int $pointsAgainst = 0;
15
    private ?string $remarks;
16
    private int $gamesWon = 0;
17
    private int $gamesLost = 0;
18
    private int $gamesDrawn = 0;
19
    private int $gamesForfeited = 0;
20
21
    public static function createFromResponse(\stdClass $response): self
22
    {
23
        $groupTeam = new self();
24
25
        $groupTeam->id = $response->guid;
26
        $groupTeam->name = $response->naam;
27
        $groupTeam->rank = (int) $response->rangNr;
28
        $groupTeam->gamesPlayed = (int) $response->wedAant;
29
        $groupTeam->rankingPoints = (int) $response->wedPunt;
30
        $groupTeam->pointsMade = (int) $response->ptVoor;
31
        $groupTeam->pointsAgainst = (int) $response->ptTegen;
32
        $groupTeam->remarks = $response->opmerk;
33
        $groupTeam->gamesWon = (int) $response->wedWinst;
34
        $groupTeam->gamesDrawn = (int) $response->wedGelijk;
35
        $groupTeam->gamesLost = (int) $response->wedVerloren;
36
        $groupTeam->gamesForfeited = (int) $response->wedNOKD;
37
38
        return $groupTeam;
39
    }
40
41
    public function getId(): string
42
    {
43
        return $this->id;
44
    }
45
46
    public function getName(): string
47
    {
48
        return $this->name;
49
    }
50
51
    public function getRank(): int
52
    {
53
        return $this->rank;
54
    }
55
56
    public function getGamesPlayed(): int
57
    {
58
        return $this->gamesPlayed;
59
    }
60
61
    public function getRankingPoints(): int
62
    {
63
        return $this->rankingPoints;
64
    }
65
66
    public function getPointsMade(): int
67
    {
68
        return $this->pointsMade;
69
    }
70
71
    public function getPointsAgainst(): int
72
    {
73
        return $this->pointsAgainst;
74
    }
75
76
    public function getRemarks(): ?string
77
    {
78
        return $this->remarks;
79
    }
80
81
    public function getGamesWon(): int
82
    {
83
        return $this->gamesWon;
84
    }
85
86
    public function getGamesLost(): int
87
    {
88
        return $this->gamesLost;
89
    }
90
91
    public function getGamesDrawn(): int
92
    {
93
        return $this->gamesDrawn;
94
    }
95
96
    public function getGamesForfeited(): int
97
    {
98
        return $this->gamesForfeited;
99
    }
100
}
101