Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
15 | 3 | public function getIpData($address, $key) |
|
16 | { |
||
17 | 3 | $curl = curl_init("http://api.ipstack.com/" . $address . '?access_key=' . $key . ''); |
|
18 | 3 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
|
19 | |||
20 | // Store the data: |
||
21 | 3 | $json = curl_exec($curl); |
|
22 | 3 | curl_close($curl); |
|
23 | |||
24 | // Decode JSON response: |
||
25 | 3 | $this->ipData = json_decode($json, true); |
|
26 | |||
27 | 3 | return $this->ipData; |
|
28 | } |
||
45 |