Total Complexity | 7 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class Accommodation |
||
7 | { |
||
8 | private string $id; |
||
9 | private ?string $name; |
||
10 | private ?string $phoneNumber; |
||
11 | private ?string $website; |
||
12 | private ?string $key; |
||
13 | private Address $address; |
||
14 | |||
15 | public static function createFromResponse(\stdClass $response): self |
||
16 | { |
||
17 | $accommodation = new self(); |
||
18 | |||
19 | $accommodation->id = $response->guid; |
||
20 | $accommodation->name = $response->naam; |
||
21 | $accommodation->phoneNumber = $response->telefoon; |
||
22 | $accommodation->website = $response->website; |
||
23 | $accommodation->key = $response->key; |
||
24 | $accommodation->address = Address::createFromResponse($response->adres); |
||
25 | |||
26 | return $accommodation; |
||
27 | } |
||
28 | |||
29 | public function getId(): ?string |
||
30 | { |
||
31 | return $this->id; |
||
32 | } |
||
33 | |||
34 | public function getName(): ?string |
||
35 | { |
||
36 | return $this->name; |
||
37 | } |
||
38 | |||
39 | public function getPhoneNumber(): ?string |
||
40 | { |
||
41 | return $this->phoneNumber; |
||
42 | } |
||
43 | |||
44 | public function getWebsite(): ?string |
||
47 | } |
||
48 | |||
49 | public function getKey(): ?string |
||
50 | { |
||
51 | return $this->key; |
||
52 | } |
||
53 | |||
54 | public function getAddress(): Address |
||
57 | } |
||
58 | } |