| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 100 | public function __construct(Factory $factory, int $min, ?int $max = null) |
|
| 23 | { |
||
| 24 | 100 | if ($max && $min > $max) { |
|
|
|
|||
| 25 | 4 | throw new \InvalidArgumentException('Min must be less than max.'); |
|
| 26 | } |
||
| 27 | |||
| 28 | 96 | $this->factory = $factory; |
|
| 29 | 96 | $this->min = $min; |
|
| 30 | 96 | $this->max = $max ?? $min; |
|
| 31 | 96 | } |
|
| 66 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: