| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | private function verifyMod10($input) |
||
| 52 | { |
||
| 53 | $sum = 0; |
||
| 54 | $input = strrev($input); |
||
| 55 | for ($i = 0; $i < strlen($input); $i++) { |
||
| 56 | $current = substr($input, $i, 1); |
||
| 57 | if ($i % 2 == 1) { |
||
| 58 | $current *= 2; |
||
| 59 | if ($current > 9) { |
||
| 60 | $firstDigit = $current % 10; |
||
| 61 | $secondDigit = ($current - $firstDigit) / 10; |
||
| 62 | $current = $firstDigit + $secondDigit; |
||
| 63 | } |
||
| 64 | } |
||
| 65 | $sum += $current; |
||
| 66 | } |
||
| 67 | |||
| 68 | return ($sum % 10 == 0); |
||
| 69 | } |
||
| 70 | } |
||
| 71 |