Code Duplication    Length = 5-5 lines in 3 locations

src/Components/CsvExport.php 1 location

@@ 160-164 (lines=5) @@
157
    protected function renderHeader($file)
158
    {
159
        $output = [];
160
        foreach ($this->grid->getConfig()->getColumns() as $column) {
161
            if (!$column->isHidden()) {
162
                $output[] = $this->escapeString($column->getLabel());
163
            }
164
        }
165
        fputcsv($file, $output, static::CSV_DELIMITER);
166
    }
167
}

src/Components/ExcelExport.php 2 locations

@@ 189-193 (lines=5) @@
186
        /** @var DataRow $row */
187
        while ($row = $provider->getRow()) {
188
            $output = [];
189
            foreach ($this->grid->getConfig()->getColumns() as $column) {
190
                if ($this->isColumnExported($column)) {
191
                    $output[] = $this->escapeString($column->getValue($row));
192
                }
193
            }
194
            $exportData[] = $output;
195
        }
196
@@ 217-221 (lines=5) @@
214
    protected function getHeaderRow()
215
    {
216
        $output = [];
217
        foreach ($this->grid->getConfig()->getColumns() as $column) {
218
            if ($this->isColumnExported($column)) {
219
                $output[] = $this->escapeString($column->getLabel());
220
            }
221
        }
222
        return $output;
223
    }
224