| Conditions | 6 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 41 | public function get($key = null, $default = null) |
||
| 42 | { |
||
| 43 | $array = $this->data; |
||
| 44 | |||
| 45 | if ($key === null) { |
||
| 46 | return $array; |
||
| 47 | } |
||
| 48 | |||
| 49 | if (array_key_exists($key, $array)) { |
||
| 50 | return $array[$key]; |
||
| 51 | } |
||
| 52 | |||
| 53 | foreach (explode('.', $key) as $segment) { |
||
| 54 | if (is_array($array) && array_key_exists($segment, $array)) { |
||
| 55 | $array = $array[$segment]; |
||
| 56 | } else { |
||
| 57 | return $default; |
||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 61 | return $array; |
||
| 62 | } |
||
| 63 | |||
| 66 |
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.