Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
31 | 8 | public function __construct(int $min = 1, ?int $max = null, int $weight = 1) |
|
32 | { |
||
33 | 8 | if ($min < 0) { |
|
34 | 1 | throw new InvalidArgumentException('Min cannot be negative.'); |
|
35 | } |
||
36 | 7 | if ($max !== null && $max < $min) { |
|
37 | 1 | throw new InvalidArgumentException('Max cannot be smaller than min.'); |
|
38 | } |
||
39 | |||
40 | 6 | $this->min = $min; |
|
41 | 6 | $this->max = $max; |
|
42 | 6 | $this->weight = $weight; |
|
43 | 6 | } |
|
88 |