Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
City | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
6 | |
100.00% |
1 / 1 |
getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getCountryCode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getState | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPostal | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLat | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLong | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package phpOMS\Localization\Defaults |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace phpOMS\Localization\Defaults; |
16 | |
17 | /** |
18 | * City class. |
19 | * |
20 | * @package phpOMS\Localization\Defaults |
21 | * @license OMS License 2.0 |
22 | * @link https://jingga.app |
23 | * @since 1.0.0 |
24 | */ |
25 | class City |
26 | { |
27 | /** |
28 | * City id. |
29 | * |
30 | * @var int |
31 | * @since 1.0.0 |
32 | */ |
33 | public int $id = 0; |
34 | |
35 | /** |
36 | * Country code. |
37 | * |
38 | * @var string |
39 | * @since 1.0.0 |
40 | */ |
41 | protected string $countryCode = ''; |
42 | |
43 | /** |
44 | * State code. |
45 | * |
46 | * @var string |
47 | * @since 1.0.0 |
48 | */ |
49 | protected string $state = ''; |
50 | |
51 | /** |
52 | * City name. |
53 | * |
54 | * @var string |
55 | * @since 1.0.0 |
56 | */ |
57 | protected string $name = ''; |
58 | |
59 | /** |
60 | * Postal code. |
61 | * |
62 | * @var int |
63 | * @since 1.0.0 |
64 | */ |
65 | protected int $postal = 0; |
66 | |
67 | /** |
68 | * Latitude. |
69 | * |
70 | * @var float |
71 | * @since 1.0.0 |
72 | */ |
73 | protected float $lat = 0.0; |
74 | |
75 | /** |
76 | * Longitude. |
77 | * |
78 | * @var float |
79 | * @since 1.0.0 |
80 | */ |
81 | protected float $long = 0.0; |
82 | |
83 | /** |
84 | * Get city name |
85 | * |
86 | * @return string |
87 | * |
88 | * @since 1.0.0 |
89 | */ |
90 | public function getName() : string |
91 | { |
92 | return $this->name; |
93 | } |
94 | |
95 | /** |
96 | * Get country code |
97 | * |
98 | * @return string |
99 | * |
100 | * @since 1.0.0 |
101 | */ |
102 | public function getCountryCode() : string |
103 | { |
104 | return $this->countryCode; |
105 | } |
106 | |
107 | /** |
108 | * Get city state |
109 | * |
110 | * @return string |
111 | * |
112 | * @since 1.0.0 |
113 | */ |
114 | public function getState() : string |
115 | { |
116 | return $this->state; |
117 | } |
118 | |
119 | /** |
120 | * Get city postal |
121 | * |
122 | * @return int |
123 | * |
124 | * @since 1.0.0 |
125 | */ |
126 | public function getPostal() : int |
127 | { |
128 | return $this->postal; |
129 | } |
130 | |
131 | /** |
132 | * Get city latitude |
133 | * |
134 | * @return float |
135 | * |
136 | * @since 1.0.0 |
137 | */ |
138 | public function getLat() : float |
139 | { |
140 | return $this->lat; |
141 | } |
142 | |
143 | /** |
144 | * Get city longitude |
145 | * |
146 | * @return float |
147 | * |
148 | * @since 1.0.0 |
149 | */ |
150 | public function getLong() : float |
151 | { |
152 | return $this->long; |
153 | } |
154 | } |