Skip to content

Commit

Permalink
Merge branch 'release/v1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxes3 committed Apr 10, 2024
2 parents 6e1fa9a + c2fbd1e commit 953f5dd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Exporter/TableExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Contracts\Translation\TranslatorInterface;

class TableExporter implements ExporterInterface
Expand Down Expand Up @@ -69,14 +68,13 @@ protected function createHeader(Worksheet $sheet, array $tableColumns): void
*/
protected function createTable(Worksheet $sheet, Table $table, array $tableColumns): void
{
$propertyAccessor = PropertyAccess::createPropertyAccessor();
foreach ($table->getRows() as $rowIndex => $row) {
$colIndex = 1;
foreach ($tableColumns as $column) {
if ($column->getOption(Column::OPT_EXPORT)[Column::OPT_EXPORT_EXPORTABLE] === false) {
continue;
}
$data = $propertyAccessor->getValue($row, $column->getOption(Column::OPT_ACCESSOR_PATH));
$data = $column->getContent($row);
if ($column->getOption(Column::OPT_FORMATTER)) {
if (is_callable($column->getOption(Column::OPT_FORMATTER))) {
$formatter = $column->getOption(Column::OPT_FORMATTER);
Expand Down

0 comments on commit 953f5dd

Please sign in to comment.