Skip to content

Commit d644de2

Browse files
committed
fix: phpstan
1 parent 06e4179 commit d644de2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Jobs/DataTableExportJob.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,13 @@ public function handle()
113113
}
114114

115115
$columns = $this->getExportableColumns($oTable);
116-
$writer->addRow(
117-
Row::fromValues(
118-
$columns->map(fn (Column $column) => strip_tags($column->title))->toArray()
119-
)
120-
);
116+
$headers = [];
117+
118+
$columns->each(function (Column $column) use (&$headers) {
119+
$headers[] = strip_tags($column->title);
120+
});
121+
122+
$writer->addRow(Row::fromValues($headers));
121123

122124
if ($this->usesLazyMethod()) {
123125
$chunkSize = intval(config('datatables-export.chunk', 1000));
@@ -145,7 +147,7 @@ public function handle()
145147
$property = $property['_'] ?? $column->name;
146148
}
147149

148-
/** @var array|bool|int|string|null $value */
150+
/** @var array|bool|int|string|null|DateTimeInterface $value */
149151
$value = $row[$property] ?? '';
150152

151153
if (is_array($value)) {

0 commit comments

Comments
 (0)