Skip to content

Commit 9ec11a0

Browse files
authored
Use variable for closure to prevent re-declaring method
1 parent 32aab07 commit 9ec11a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Services/DataTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,15 +800,15 @@ protected function buildFastExcelFile(): FastExcel
800800

801801
if ($dataTable instanceof QueryDataTable) {
802802
// @phpstan-ignore-next-line
803-
function queryGenerator($dataTable): Generator
803+
$queryGenerator = function ($dataTable): Generator
804804
{
805805
foreach ($dataTable->getFilteredQuery()->cursor() as $row) {
806806
yield $row;
807807
}
808-
}
808+
};
809809

810810
// @phpstan-ignore-next-line
811-
return new FastExcel(queryGenerator($dataTable));
811+
return new FastExcel($queryGenerator($dataTable));
812812
}
813813

814814
return new FastExcel($dataTable->toArray()['data']);

0 commit comments

Comments
 (0)