| 1 | <?php |
||
| 16 | class GeoData implements GeoDataInterface |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Data to keep. |
||
| 20 | * |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | private $data = []; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * GeoDataInterface constructor. |
||
| 27 | * |
||
| 28 | * @param array $data |
||
| 29 | */ |
||
| 30 | public function __construct(array $data = []) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Gets country code. |
||
| 37 | * |
||
| 38 | * @return null|string |
||
| 39 | */ |
||
| 40 | public function getCountryCode(): ?string |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Gets country name |
||
| 48 | * |
||
| 49 | * @return null|string |
||
| 50 | */ |
||
| 51 | public function getCountryName(): ?string |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Gets region |
||
| 59 | * |
||
| 60 | * @return null|string |
||
| 61 | */ |
||
| 62 | public function getRegion(): ?string |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Gets region name |
||
| 70 | * |
||
| 71 | * @return null|string |
||
| 72 | */ |
||
| 73 | public function getRegionName(): ?string |
||
| 78 | |||
| 79 | /** |
||
| 80 | * Gets region code |
||
| 81 | * |
||
| 82 | * @return null|string |
||
| 83 | */ |
||
| 84 | public function getRegionCode(): ?string |
||
| 89 | |||
| 90 | /** |
||
| 91 | * Gets city |
||
| 92 | * |
||
| 93 | * @return null|string |
||
| 94 | */ |
||
| 95 | public function getCity(): ?string |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Gets latitude |
||
| 103 | * |
||
| 104 | * @return null|string |
||
| 105 | */ |
||
| 106 | public function getLatitude(): ?string |
||
| 111 | |||
| 112 | /** |
||
| 113 | * Gets longitude |
||
| 114 | * |
||
| 115 | * @return null|string |
||
| 116 | */ |
||
| 117 | public function getLongitude(): ?string |
||
| 122 | |||
| 123 | /** |
||
| 124 | * Gets IP |
||
| 125 | * |
||
| 126 | * @return null|string |
||
| 127 | */ |
||
| 128 | public function getIp(): string |
||
| 133 | |||
| 134 | /** |
||
| 135 | * Gets all data |
||
| 136 | * |
||
| 137 | * @return array |
||
| 138 | */ |
||
| 139 | public function getData(): array |
||
| 143 | |||
| 144 | /** |
||
| 145 | * Sets all data |
||
| 146 | * |
||
| 147 | * @param array $data |
||
| 148 | */ |
||
| 149 | public function setData(array $data): void |
||
| 153 | } |