Conditions | 9 |
Paths | 8 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | private function isNationalCardValid(mixed $value): bool |
||
33 | { |
||
34 | if (! preg_match('/^\d{10}$/', $value)) { |
||
35 | return false; |
||
36 | } |
||
37 | |||
38 | for ($i = 0; $i < 10; $i++) { |
||
39 | if (preg_match('/^'.$i.'{10}$/', $value)) { |
||
40 | return false; |
||
41 | } |
||
42 | } |
||
43 | |||
44 | for ($i = 0, $sum = 0; $i < 9; $i++) { |
||
45 | $sum += ((10 - $i) * intval(substr($value, $i, 1))); |
||
46 | $ret = $sum % 11; |
||
47 | $parity = intval(substr($value, 9, 1)); |
||
48 | if (($ret < 2 && $ret == $parity) || ($ret >= 2 && $ret == 11 - $parity)) { |
||
49 | return true; |
||
50 | } |
||
51 | } |
||
52 | |||
53 | return false; |
||
54 | } |
||
56 |
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