Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning for PHP 8.4 implicit nullable parameter #180

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading