Conditions | 8 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
34 | public function __construct($min = null, $max = null) |
||
35 | { |
||
36 | if ($min === null && $max === null) { |
||
37 | throw new InvalidArgumentException('Either option "min" or "max" must be given.'); |
||
38 | } |
||
39 | |||
40 | if ($min !== null && $max !== null && $min > $max) { |
||
41 | throw new LogicException('"Min" option cannot be greater that "max".'); |
||
42 | } |
||
43 | |||
44 | if ($max !== null && $max < $min) { |
||
45 | throw new LogicException('"Max" option cannot be less that "min".'); |
||
46 | } |
||
47 | |||
48 | $this->min = $min; |
||
49 | $this->max = $max; |
||
50 | } |
||
96 |