| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 3 | public function indexActionPost() : array |
|
| 22 | { |
||
| 23 | 3 | $ip = $this->di->request->getPost("ip"); |
|
|
|
|||
| 24 | 3 | $res = $this->di->ip->validate($ip); |
|
| 25 | |||
| 26 | 3 | if (is_null($res)) { |
|
| 27 | 1 | $json = [ "message" => "Ingen IP address skickades." ]; |
|
| 28 | 1 | return [ $json, 400 ]; |
|
| 29 | } |
||
| 30 | |||
| 31 | 2 | return [ (array) $res, 200 ]; |
|
| 32 | } |
||
| 34 |