Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | 20 | public function calculateDigit(string $baseNumber) : string |
|
14 | { |
||
15 | 20 | $pis = substr($baseNumber, 0, 11); |
|
16 | |||
17 | 20 | $calculator = new DigitCalculator($pis); |
|
18 | 20 | $calculator->useComplementaryInsteadOfModule(); |
|
19 | 20 | $calculator->replaceWhen('8', 10); |
|
20 | 20 | $calculator->replaceWhen('0', 11); |
|
21 | 20 | $calculator->withMultipliersInterval(5, 15); |
|
22 | |||
23 | 20 | $digit = $calculator->calculate(); |
|
24 | |||
25 | 20 | return "{$digit}"; |
|
26 | } |
||
28 |