| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 19 |
| Ratio | 100 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | View Code Duplication | protected function arrayToXmlWriter(\XmlWriter $x, array $array) |
|
| 46 | { |
||
| 47 | foreach ($array as $k => $v) { |
||
| 48 | // replace numeric index key to 'item' e.g. <results><item>...</item></results> |
||
| 49 | if (is_array($v)) { |
||
| 50 | if (is_int($k)) { |
||
| 51 | $k = $this->items_key; |
||
| 52 | } |
||
| 53 | $x->startElement($k); |
||
| 54 | $this->arrayToXmlWriter($x, $v); |
||
| 55 | $x->endElement(); |
||
| 56 | } else { |
||
| 57 | if (is_int($k)) { |
||
| 58 | $k = $this->item_key; |
||
| 59 | } |
||
| 60 | $x->writeElement($k, $v); // XmlWriter bug |
||
| 61 | } |
||
| 62 | } |
||
| 63 | } |
||
| 64 | |||
| 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.