| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | 6 | public function getIpType(string $ipAdr) |
|
| 35 | { |
||
| 36 | 6 | $type = null; |
|
| 37 | |||
| 38 | 6 | if (filter_var($ipAdr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { |
|
| 39 | 3 | $type = "IPV4"; |
|
| 40 | 3 | } elseif (filter_var($ipAdr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { |
|
| 41 | 2 | $type = "IPV6"; |
|
| 42 | } |
||
| 43 | |||
| 44 | 6 | return $type; |
|
| 45 | } |
||
| 59 |