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