Code Duplication    Length = 5-5 lines in 3 locations

src/Components/CsvExport.php 1 location

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

src/Components/ExcelExport.php 2 locations

@@ 197-201 (lines=5) @@
194
        /** @var DataRow $row */
195
        while ($row = $provider->getRow()) {
196
            $output = [];
197
            foreach ($this->grid->getConfig()->getColumns() as $column) {
198
                if ($this->isColumnExported($column)) {
199
                    $output[] = $this->escapeString($column->getValue($row));
200
                }
201
            }
202
            $exportData[] = $output;
203
        }
204
@@ 225-229 (lines=5) @@
222
    protected function getHeaderRow()
223
    {
224
        $output = [];
225
        foreach ($this->grid->getConfig()->getColumns() as $column) {
226
            if ($this->isColumnExported($column)) {
227
                $output[] = $this->escapeString($column->getLabel());
228
            }
229
        }
230
        return $output;
231
    }
232