| Total Complexity | 6 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
||
| 45 | } |
||
| 46 | |||
| 47 | public function getStaff(): StaffCollection |
||
| 50 | } |
||
| 51 | } |