1 | <?php |
||
18 | class IpstackAdapter implements GeoAdapterInterface |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * ipstack API-key |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | public $apiKey = ''; |
||
27 | |||
28 | /** |
||
29 | * Loads location data from source for $ip |
||
30 | * |
||
31 | * @param $ip |
||
32 | * |
||
33 | * @return bool|string |
||
34 | */ |
||
35 | public function loadLocationData($ip) |
||
41 | |||
42 | /** |
||
43 | * Gets location data from loaded data |
||
44 | * |
||
45 | * @param $ip |
||
46 | * |
||
47 | * @return GeoDataInterface |
||
48 | * |
||
49 | * @throws EmptyLocationDataException |
||
50 | */ |
||
51 | public function getLocationData($ip): GeoDataInterface |
||
76 | |||
77 | /** |
||
78 | * Gets adapter's name |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getName(): string |
||
86 | } |
||
87 |