Conditions | 5 |
Paths | 5 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 5.1158 |
Changes | 0 |
1 | <?php |
||
17 | 2 | public function determineCarry(int $digit, int $nextDigit): int |
|
18 | { |
||
19 | 2 | $early = static::nonHalfEarlyReturn($digit); |
|
20 | 2 | $remainder = $this->remainderCheck(); |
|
21 | |||
22 | 2 | if ($early == 0 && !$remainder) { |
|
23 | 2 | return RandomProvider::randomInt(0, 1, RandomMode::Speed)->asInt(); |
|
24 | } else { |
||
25 | return (($early == 1 || $remainder) ? 1 : 0); |
||
26 | } |
||
28 | } |