BoardMember::createFromResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 13
rs 9.9666
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Eekes\VblApi\Entity;
5
6
class BoardMember
7
{
8
    private string $id;
9
    private ?string $group;
10
    private ?string $function;
11
    private string $name;
12
    private ?string $phoneNumber;
13
    private ?string $mobilePhone;
14
    private ?string $email;
15
16
    public static function createFromResponse(\stdClass $response): self
17
    {
18
        $member = new self();
19
20
        $member->id = $response->relGuid;
21
        $member->group = $response->kmGroep;
22
        $member->function = $response->kenmerk;
23
        $member->name = $response->naam;
24
        $member->phoneNumber = $response->telefoon;
25
        $member->mobilePhone = $response->mobiel;
26
        $member->email = $response->email;
27
28
        return $member;
29
    }
30
31
    public function getId(): string
32
    {
33
        return $this->id;
34
    }
35
36
    public function getGroup(): ?string
37
    {
38
        return $this->group;
39
    }
40
41
    public function getFunction(): ?string
42
    {
43
        return $this->function;
44
    }
45
46
    public function getName(): string
47
    {
48
        return $this->name;
49
    }
50
51
    public function getPhoneNumber(): ?string
52
    {
53
        return $this->phoneNumber;
54
    }
55
56
    public function getMobilePhone(): ?string
57
    {
58
        return $this->mobilePhone;
59
    }
60
61
    public function getEmail(): ?string
62
    {
63
        return $this->email;
64
    }
65
}