Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
14 | 3 | public function __construct($value) |
|
15 | { |
||
16 | 3 | $filteredValue = filter_var($value, FILTER_VALIDATE_IP); |
|
17 | |||
18 | 3 | if ($filteredValue === false) { |
|
19 | 1 | throw new InvalidNativeArgumentException($value, array('string (valid ip address)')); |
|
20 | } |
||
21 | |||
22 | 2 | $this->value = $filteredValue; |
|
23 | 2 | } |
|
24 | |||
41 |