Conditions | 8 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | public function __construct( |
||
47 | $min = null, |
||
48 | $max = null, |
||
49 | $charset = 'UTF-8' |
||
50 | ) { |
||
51 | if ($min === null && $max === null) { |
||
52 | throw new InvalidArgumentException('Either option "min" or "max" must be given.'); |
||
53 | } |
||
54 | |||
55 | if ($min !== null && $max !== null && $min > $max) { |
||
56 | throw new LogicException('"Min" option cannot be greater that "max".'); |
||
57 | } |
||
58 | |||
59 | if ($max !== null && $max < $min) { |
||
60 | throw new LogicException('"Max" option cannot be less that "min".'); |
||
61 | } |
||
62 | |||
63 | $this->min = $min; |
||
64 | $this->max = $max; |
||
65 | $this->charset = $charset; |
||
66 | } |
||
108 |