| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 8 | public function setLocation(string $ip) |
|
| 25 | { |
||
| 26 | 8 | $curl = $this->curl; |
|
| 27 | 8 | $url = "http://api.ipstack.com/" . $ip . "?access_key=" . $this->apiKey; |
|
| 28 | |||
| 29 | 8 | $res = $curl->get($url); |
|
| 30 | |||
| 31 | 8 | $this->ip = $res->ip; |
|
| 32 | 8 | $this->type = $res->type; |
|
| 33 | 8 | $this->city = $res->city; |
|
| 34 | 8 | $this->country = $res->country_name; |
|
| 35 | 8 | $this->lat = $res->latitude; |
|
| 36 | 8 | $this->long = $res->longitude; |
|
| 37 | 8 | } |
|
| 69 |