Total Complexity | 9 |
Total Lines | 73 |
Duplicated Lines | 0 % |
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 | 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 | $this->countryCode = $countryCode; |
||
33 | $this->countryName = $countryName; |
||
34 | $this->regionName = $regionName; |
||
35 | $this->city = $city; |
||
36 | $this->latitude = $latitude; |
||
37 | $this->longitude = $longitude; |
||
38 | $this->timeZone = $timeZone; |
||
39 | } |
||
40 | |||
41 | public static function emptyInstance(): self |
||
42 | { |
||
43 | return new self('', '', '', '', 0.0, 0.0, ''); |
||
44 | } |
||
45 | |||
46 | public function countryCode(): string |
||
47 | { |
||
48 | return $this->countryCode; |
||
49 | } |
||
50 | |||
51 | public function countryName(): string |
||
52 | { |
||
53 | return $this->countryName; |
||
54 | } |
||
55 | |||
56 | public function regionName(): string |
||
59 | } |
||
60 | |||
61 | public function city(): string |
||
62 | { |
||
63 | return $this->city; |
||
64 | } |
||
65 | |||
66 | public function latitude(): float |
||
69 | } |
||
70 | |||
71 | public function longitude(): float |
||
72 | { |
||
73 | return $this->longitude; |
||
74 | } |
||
75 | |||
76 | public function timeZone(): string |
||
79 | } |
||
80 | } |
||
81 |