| Conditions | 5 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5.2742 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | 1 | public function determineCarry(int $digit, int $nextDigit): int |
|
| 16 | { |
||
| 17 | 1 | $early = static::nonHalfEarlyReturn($digit); |
|
| 18 | 1 | $remainder = $this->remainderCheck(); |
|
| 19 | |||
| 20 | 1 | if ($early == 0 && !$remainder) { |
|
| 21 | 1 | $val = $this->alt; |
|
| 22 | 1 | $this->alt = (int)!$val; |
|
| 23 | |||
| 24 | 1 | return $val; |
|
| 25 | } else { |
||
| 26 | return (($early == 1 || $remainder) ? 1 : 0); |
||
| 27 | } |
||
| 29 | } |