| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | 25 | public function test(int $value): bool |
|
| 49 | { |
||
| 50 | 25 | $boundary = 1 / $this->bounds; |
|
| 51 | |||
| 52 | 25 | $positionDenominator = $this->bounds - $value; |
|
| 53 | |||
| 54 | // Div by zero |
||
| 55 | 25 | if (0 === $positionDenominator) { |
|
| 56 | 3 | $this->throwBoundaryTestException($value); |
|
| 57 | } |
||
| 58 | |||
| 59 | 23 | $position = 1 / $positionDenominator; |
|
| 60 | |||
| 61 | 23 | if ($position < $boundary) { |
|
| 62 | 5 | $this->throwBoundaryTestException($value); |
|
| 63 | } |
||
| 64 | |||
| 65 | 20 | return true; |
|
| 66 | } |
||
| 67 | |||
| 80 |