| Total Complexity | 2 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 17.65% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class IpGeo |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string $ipinput userinputted ip |
||
| 12 | * @var string $curl curl-object |
||
| 13 | */ |
||
| 14 | public $ipinput; |
||
| 15 | private $curl; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Constructor to assign user input and address to use |
||
| 19 | * |
||
| 20 | * @param null|string $ipinp User input |
||
| 21 | */ |
||
| 22 | 1 | public function setInput(string $ipinp = "") |
|
| 25 | 1 | } |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Method for retriving the geo-coordinates for given ip-address |
||
| 29 | * @return array With parts of valid JSON-repsonse |
||
| 30 | */ |
||
| 31 | public function fetchGeo($url = "http://api.ipstack.com/") |
||
| 55 |