| Conditions | 4 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | public function renderElements() |
||
| 9 | { |
||
| 10 | $elements = $this->getElements(); |
||
| 11 | if ($elements) { |
||
|
|
|||
| 12 | foreach ($elements as $element) { |
||
| 13 | if (!$element->isRendered()) { |
||
| 14 | $idRow = $element->getUniqueId(); |
||
| 15 | $this->setRowAttrib($idRow, 'class', "row " . $idRow); |
||
| 16 | $this->addCell($idRow, 1, $element, 'label'); |
||
| 17 | $this->addCell($idRow, 2, $element, 'value'); |
||
| 18 | } |
||
| 19 | } |
||
| 20 | } |
||
| 21 | return parent::renderElements(); |
||
| 22 | } |
||
| 24 |
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.