Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | 1 | public function getType(string $ipAddress) : string |
|
41 | { |
||
42 | 1 | $type = ""; |
|
43 | |||
44 | switch ($ipAddress) { |
||
45 | 1 | case (filter_var($ipAddress, FILTER_VALIDATE_IP, $this->ipV4)): |
|
46 | 1 | $type = "IPv4"; |
|
47 | 1 | break; |
|
48 | 1 | case (filter_var($ipAddress, FILTER_VALIDATE_IP, $this->ipV6)): |
|
49 | 1 | $type = "IPv6"; |
|
50 | 1 | break; |
|
51 | } |
||
52 | |||
53 | 1 | return $type; |
|
54 | } |
||
72 |