Skip to content

Commit

Permalink
Improve setting rows to avoid php warning by FastExcelWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Nov 1, 2023
1 parent 329bd39 commit 0580259
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/HtmlPhpExcel/HtmlPhpExcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ private function createExcel(): void
$rowIndex = 1;
foreach($table->getRows() as $row) {
$rowStyles = $this->getStyles($row);
$sheet->setRowStyles(
$rowIndex,
empty($rowStyles) ? null : $rowStyles
);
if (!empty($rowStyles)) {
$sheet->setRowStyles(
$rowIndex,
$rowStyles
);
}

// Loop over all cells in a row
$colIndex = 1;
Expand Down

0 comments on commit 0580259

Please sign in to comment.