Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | private function isCreditCardValid(mixed $value): bool |
||
33 | { |
||
34 | $value = preg_replace('/\D/', '', $value); |
||
35 | |||
36 | $numLength = strlen($value); |
||
37 | $sum = 0; |
||
38 | $reverse = strrev($value); |
||
39 | |||
40 | for ($i = 0; $i < $numLength; $i++) { |
||
41 | $currentNum = intval($reverse[$i]); |
||
42 | if ($i % 2 == 1) { |
||
43 | $currentNum *= 2; |
||
44 | if ($currentNum > 9) { |
||
45 | $currentNum -= 9; |
||
46 | } |
||
47 | } |
||
48 | $sum += $currentNum; |
||
49 | } |
||
50 | |||
51 | return $sum % 10 == 0; |
||
52 | } |
||
54 |
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