Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | public function __construct($value) |
||
29 | { |
||
30 | $options = array( |
||
31 | 'options' => array( |
||
32 | 'min_range' => 0, |
||
33 | 'max_range' => 65535, |
||
34 | ), |
||
35 | ); |
||
36 | |||
37 | $value = filter_var($value, FILTER_VALIDATE_INT, $options); |
||
38 | if ($value === false) { |
||
39 | throw new \InvalidArgumentException(sprintf( |
||
40 | 'Argument "%s" is invalid. Allowed types for argument are "int".', |
||
41 | $value |
||
42 | )); |
||
43 | } |
||
44 | |||
45 | parent::__construct($value); |
||
46 | } |
||
47 | } |
||
48 |