Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class IpTest |
||
10 | { |
||
11 | /** |
||
12 | * @var string $ipinput userinputted ip |
||
13 | */ |
||
14 | private $ipinput; |
||
15 | |||
16 | /** |
||
17 | * Function to set user ip |
||
18 | * |
||
19 | * @param null|string $ipinp User input |
||
20 | */ |
||
21 | 9 | public function setInput(string $ipinp = "") |
|
22 | { |
||
23 | 9 | $this->ipinput = $ipinp; |
|
24 | 9 | } |
|
25 | |||
26 | /** |
||
27 | * method for checking Ip4 |
||
28 | * @return bool if valid, return true |
||
29 | */ |
||
30 | 8 | public function ip4test() |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * method for checking Ip6 |
||
40 | * @return bool if valid, return true |
||
41 | */ |
||
42 | 8 | public function ip6test() |
|
50 |