Skip to content

Commit

Permalink
Merge pull request #180 from hmazter/php-84-implicit-nullable
Browse files Browse the repository at this point in the history
Fix deprecation warning for PHP 8.4 implicit nullable parameter
  • Loading branch information
freekmurze authored Dec 16, 2024
2 parents ff93066 + c853f16 commit 1dfc9c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/SimpleExcelReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function preserveEmptyRows(): self
return $this;
}

public function trimHeaderRow(string $characters = null): self
public function trimHeaderRow(?string $characters = null): self
{
$this->trimHeader = true;
$this->trimHeaderCharacters = $characters;
Expand Down
8 changes: 4 additions & 4 deletions src/SimpleExcelWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SimpleExcelWriter
public static function create(
string $file,
string $type = '',
callable $configureWriter = null,
?callable $configureWriter = null,
?string $delimiter = null,
?bool $shouldAddBom = null,
): static {
Expand Down Expand Up @@ -59,7 +59,7 @@ public static function createWithoutBom(string $file, string $type = ''): static
public static function streamDownload(
string $downloadName,
string $type = '',
callable $writerCallback = null,
?callable $writerCallback = null,
?string $delimiter = null,
?bool $shouldAddBom = null,
): static {
Expand Down Expand Up @@ -148,7 +148,7 @@ public function setHeaderStyle(Style $style): static
return $this;
}

public function addRow(Row|array $row, Style $style = null): static
public function addRow(Row|array $row, ?Style $style = null): static
{
if (is_array($row)) {
if ($this->processHeader && $this->processingFirstRow) {
Expand All @@ -166,7 +166,7 @@ public function addRow(Row|array $row, Style $style = null): static
return $this;
}

public function addRows(iterable $rows, Style $style = null): static
public function addRows(iterable $rows, ?Style $style = null): static
{
foreach ($rows as $row) {
$this->addRow($row, $style);
Expand Down

0 comments on commit 1dfc9c0

Please sign in to comment.