| Conditions | 5 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | private function isImeiValid(mixed $value): bool |
||
| 33 | { |
||
| 34 | $imei = $value; |
||
| 35 | |||
| 36 | if (strlen($imei) != 15 || ! ctype_digit($imei)) { |
||
| 37 | return false; |
||
| 38 | } |
||
| 39 | |||
| 40 | $digits = str_split($imei); // Get digits |
||
| 41 | $imei_last = array_pop($digits); // Remove last digit, and store it |
||
| 42 | $log = []; |
||
| 43 | |||
| 44 | foreach ($digits as $key => $n) { |
||
| 45 | if ($key & 1) { |
||
| 46 | $double = str_split($n * 2); // Get double digits |
||
| 47 | $n = array_sum($double); // Sum double digits |
||
| 48 | } |
||
| 49 | |||
| 50 | $log[] = $n; // Append log |
||
| 51 | } |
||
| 52 | $sum = array_sum($log) * 9; // Sum log & multiply by 9 |
||
| 53 | |||
| 54 | return substr($sum, -1) === $imei_last; |
||
| 55 | } |
||
| 57 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths