Total Complexity | 2 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class IpLocator |
||
10 | { |
||
11 | private const IPSTACK_BASE_URL = "http://api.ipstack.com/"; |
||
12 | private $apiKey; |
||
13 | private $curl; |
||
14 | |||
15 | |||
16 | 1 | public function __construct($apiKey, $curl) |
|
17 | { |
||
18 | 1 | $this->apiKey = $apiKey; |
|
19 | 1 | $this->curl = $curl; |
|
20 | 1 | } |
|
21 | |||
22 | /** |
||
23 | * Gets geographical information from ipstack for the supplied IP-address. |
||
24 | * |
||
25 | * @param string $ip |
||
26 | * @return array |
||
27 | */ |
||
28 | 1 | public function getGeoInfo(string $ip) : array |
|
35 | } |
||
36 | } |
||
37 |