Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
15 | 15 | public function __construct($value) |
|
16 | { |
||
17 | $options = array( |
||
18 | 'options' => array( |
||
19 | 15 | 'min_range' => 0, |
|
20 | 'max_range' => 65535 |
||
21 | 15 | ) |
|
22 | 15 | ); |
|
23 | |||
24 | 15 | $filteredValue = filter_var($value, FILTER_VALIDATE_INT, $options); |
|
25 | |||
26 | 15 | if (false === $filteredValue) { |
|
27 | 1 | throw new InvalidNativeArgumentException($value, array('int (>=0, <=65535)')); |
|
28 | } |
||
29 | |||
30 | 14 | parent::__construct($filteredValue); |
|
31 | 14 | } |
|
32 | } |
||
33 |