Code Duplication    Length = 5-5 lines in 3 locations

src/Components/CsvExport.php 1 location

@@ 173-177 (lines=5) @@
170
    protected function renderHeader($file)
171
    {
172
        $output = [];
173
        foreach ($this->grid->getConfig()->getColumns() as $column) {
174
            if (!$column->isHidden()) {
175
                $output[] = $this->escapeString($column->getLabel());
176
            }
177
        }
178
        fputcsv($file, $output, static::CSV_DELIMITER);
179
    }
180
}

src/Components/ExcelDispatchJobService.php 2 locations

@@ 288-292 (lines=5) @@
285
        /** @var DataRow $row */
286
        while ($row = $provider->getRow()) {
287
            $output = [];
288
            foreach ($this->getConfig()->getColumns() as $column) {
289
                if ($this->isColumnExported($column)) {
290
                    $output[] = $this->escapeString($column->getValue($row));
291
                }
292
            }
293
            $exportData[] = $output;
294
        }
295
        return $exportData;
@@ 315-319 (lines=5) @@
312
    protected function getHeaderRow()
313
    {
314
        $output = [];
315
        foreach ($this->getConfig()->getColumns() as $column) {
316
            if ($this->isColumnExported($column)) {
317
                $output[] = $this->escapeString($column->getLabel());
318
            }
319
        }
320
        return $output;
321
    }
322