Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 1 | public function indexActionPost() : array |
|
20 | { |
||
21 | 1 | $request = $this->di->get("request"); |
|
22 | 1 | $ipAddress = $request->getPost("ip"); |
|
23 | |||
24 | 1 | $geo = $this->validator->getGeo($ipAddress); |
|
25 | |||
26 | $json = [ |
||
27 | 1 | "ip" => $ipAddress, |
|
28 | 1 | "ipv4" => $this->validator->verifyIpv4($ipAddress), |
|
29 | 1 | "ipv6" => $this->validator->verifyIpv6($ipAddress), |
|
30 | 1 | "domain" => $this->validator->getDomain($ipAddress), |
|
31 | 1 | "latitude" => $geo["latitude"], |
|
32 | 1 | "longitude" => $geo["longitude"], |
|
33 | 1 | "country_name" => $geo["country_name"], |
|
34 | 1 | "region_name" => $geo["region_name"], |
|
35 | 1 | "city" => $geo["city"] |
|
36 | ]; |
||
37 | |||
38 | 1 | return [$json]; |
|
39 | } |
||
41 |