| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | protected function renderRecursive($items) |
||
| 48 | { |
||
| 49 | foreach ($items as $item) { |
||
| 50 | echo Html::beginTag('li', ['class' => 'dd-item', 'data-id' => $item->id]); |
||
| 51 | echo $this->getView()->render('_render-item', ['item' => $item]); |
||
| 52 | if (isset($item->items) && count($item->items)) { |
||
| 53 | echo Html::beginTag('ul', ['class' => 'dd-list children']); |
||
| 54 | $this->renderRecursive($item['items']); |
||
| 55 | echo Html::endTag('ul'); |
||
| 56 | } |
||
| 57 | echo Html::endTag('li'); |
||
| 58 | } |
||
| 59 | } |
||
| 60 | } |
||
| 61 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.