Code Duplication    Length = 5-7 lines in 3 locations

src/renderable/Collection.php 2 locations

@@ 160-164 (lines=5) @@
157
            // Render each entity view in collection
158
            foreach ($collection as $row) {
159
                // Call external handler
160
                if (is_callable($this->itemView)) {
161
                    $html .= call_user_func($this->itemView, $row, $this->renderer, $this->query, $collection);
162
                } else { // Call default renderer
163
                    $html .= $this->renderItem($row);
164
                }
165
            }
166
167
            // Render collection main view with items
@@ 173-179 (lines=7) @@
170
            } else { // Call default renderer
171
                $html = $this->renderIndex($html);
172
            }
173
        } else { // Render empty entity view
174
            if (is_callable($this->emptyView)) {
175
                $html .= call_user_func($this->emptyView, $html, $this->renderer, $this->query, $collection);
176
            } else {
177
                $html .= $this->renderEmpty();
178
            }
179
        }
180
181
        return $html;
182
    }

src/renderable/FieldsTable.php 1 location

@@ 110-114 (lines=5) @@
107
        $html = '';
108
        foreach ($this->collection as $row) {
109
            // Call external handler
110
            if (is_callable($this->rowView)) {
111
                $html .= call_user_func($this->rowView, $row, $this->renderer, $this->query, $this->collection);
112
            } else { // Call default renderer
113
                $html .= $this->renderRow($row);
114
            }
115
        }
116
117
        // Call external handler