Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 3 | public function getProtocol($ipAddress) |
|
37 | { |
||
38 | 3 | $protocol = ""; |
|
39 | 3 | if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { |
|
40 | 2 | $protocol = "IPv4"; |
|
41 | } |
||
42 | 3 | if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { |
|
43 | 1 | $protocol = "IPv6"; |
|
44 | } |
||
45 | 3 | return $protocol; |
|
46 | } |
||
57 |