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