| Conditions | 4 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | private function validateLuhnAlgorithm($imei) |
||
| 43 | { |
||
| 44 | $str = ''; |
||
| 45 | |||
| 46 | foreach (str_split(strrev((string) $imei)) as $i => $d) { |
||
| 47 | $str .= $i %2 !== 0 ? $d * 2 : $d; |
||
| 48 | } |
||
| 49 | |||
| 50 | if (array_sum(str_split($str)) % 10 !== 0) { |
||
| 51 | throw new InvalidNativeArgumentException($imei, array('int (valid Imei code)')); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $imei; |
||
| 55 | } |
||
| 56 | } |
||
| 57 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.