Total Complexity | 9 |
Total Lines | 73 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
6 | final class Location |
||
7 | { |
||
8 | /** @var string */ |
||
9 | private $countryCode; |
||
10 | /** @var string */ |
||
11 | private $countryName; |
||
12 | /** @var string */ |
||
13 | private $regionName; |
||
14 | /** @var string */ |
||
15 | private $city; |
||
16 | /** @var float */ |
||
17 | private $latitude; |
||
18 | /** @var float */ |
||
19 | private $longitude; |
||
20 | /** @var string */ |
||
21 | private $timeZone; |
||
22 | |||
23 | 33 | public function __construct( |
|
24 | string $countryCode, |
||
25 | string $countryName, |
||
26 | string $regionName, |
||
27 | string $city, |
||
28 | float $latitude, |
||
29 | float $longitude, |
||
30 | string $timeZone |
||
31 | ) { |
||
32 | 33 | $this->countryCode = $countryCode; |
|
33 | 33 | $this->countryName = $countryName; |
|
34 | 33 | $this->regionName = $regionName; |
|
35 | 33 | $this->city = $city; |
|
36 | 33 | $this->latitude = $latitude; |
|
37 | 33 | $this->longitude = $longitude; |
|
38 | 33 | $this->timeZone = $timeZone; |
|
39 | } |
||
40 | |||
41 | 19 | public static function emptyInstance(): self |
|
42 | { |
||
43 | 19 | return new self('', '', '', '', 0.0, 0.0, ''); |
|
44 | } |
||
45 | |||
46 | 22 | public function countryCode(): string |
|
47 | { |
||
48 | 22 | return $this->countryCode; |
|
49 | } |
||
50 | |||
51 | 22 | public function countryName(): string |
|
52 | { |
||
53 | 22 | return $this->countryName; |
|
54 | } |
||
55 | |||
56 | 22 | public function regionName(): string |
|
59 | } |
||
60 | |||
61 | 22 | public function city(): string |
|
62 | { |
||
63 | 22 | return $this->city; |
|
64 | } |
||
65 | |||
66 | 22 | public function latitude(): float |
|
69 | } |
||
70 | |||
71 | 22 | public function longitude(): float |
|
72 | { |
||
73 | 22 | return $this->longitude; |
|
74 | } |
||
75 | |||
76 | 22 | public function timeZone(): string |
|
79 | } |
||
80 | } |
||
81 |