| Conditions | 4 |
| Paths | 5 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | private static function initChecks($configArray, HealthFoundation $healthFoundation) |
||
| 30 | { |
||
| 31 | foreach ($configArray['checks'] as $key => $checkArray) { |
||
| 32 | |||
| 33 | /** @var Check $check */ |
||
| 34 | $check = Init::initialize($checkArray, 'check'); |
||
|
|
|||
| 35 | |||
| 36 | if (array_key_exists('description', $checkArray)) { |
||
| 37 | $description = $checkArray['description']; |
||
| 38 | } else { |
||
| 39 | $description = ""; |
||
| 40 | } |
||
| 41 | |||
| 42 | if (array_key_exists('identifier', $checkArray)) { |
||
| 43 | $identifier = $checkArray['identifier']; |
||
| 44 | } else { |
||
| 45 | $identifier = $key; |
||
| 46 | } |
||
| 47 | |||
| 48 | $healthFoundation->registerCheck($check, $identifier, $description); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $healthFoundation; |
||
| 52 | } |
||
| 54 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.