1 | <?php |
||
2 | |||
3 | class Nip_Form_Renderer_Basic extends Nip_Form_Renderer_Table |
||
4 | { |
||
5 | /** |
||
6 | * @inheritDoc |
||
7 | */ |
||
8 | public function renderElements() |
||
9 | { |
||
10 | $elements = $this->getElements(); |
||
11 | if ($elements) { |
||
0 ignored issues
–
show
|
|||
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 | } |
||
23 | } |
||
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.