Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
25 | 2 | public function getJson(string $ipAdd) |
|
26 | { |
||
27 | 2 | $url = "http://api.ipstack.com/$ipAdd?access_key={$this->apikey}&hostname=1"; |
|
28 | 2 | $res = file_get_contents($url); |
|
29 | 2 | $ipinfo = json_decode($res, true); |
|
30 | 2 | $lat = $ipinfo["latitude"]; |
|
31 | 2 | $lng = $ipinfo["longitude"]; |
|
32 | 2 | $ipinfo['link'] = "https://www.openstreetmap.org/?mlat=$lat&mlon=$lng#map=15/$lat/$lng"; |
|
33 | // var_dump($ipinfo); |
||
34 | 2 | return $ipinfo; |
|
35 | } |
||
37 |