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