Conditions | 5 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public static function merge(array $original, array $override) |
||
29 | { |
||
30 | foreach ($override as $key => $value) { |
||
31 | if (isset($original[$key])) { |
||
32 | if (!is_array($original[$key])) { |
||
33 | // Override scalar value |
||
34 | $original[$key] = $value; |
||
35 | } elseif (array_keys($original[$key]) === range(0, count($original[$key]) - 1)) { |
||
36 | // Uniquely append to array with numeric keys |
||
37 | $original[$key] = array_unique(array_merge($original[$key], $value)); |
||
38 | } else { |
||
39 | // Merge all other arrays |
||
40 | $original[$key] = Config::merge($original[$key], $value); |
||
41 | } |
||
42 | } else { |
||
43 | // Simply add new key/value |
||
44 | $original[$key] = $value; |
||
45 | } |
||
46 | } |
||
47 | |||
48 | return $original; |
||
49 | } |
||
50 | } |
||
51 |
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
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.