From c141f004e65aa180cecd6e81da879231f52b04c8 Mon Sep 17 00:00:00 2001
From: "Chun-Sheng, Li"
Date: Fri, 22 Sep 2023 17:48:13 +0800
Subject: [PATCH] Let variables be default nullable values (#181)
---
src/Reader/CSV/RowIterator.php | 2 +-
src/Reader/ODS/RowIterator.php | 4 ++--
src/Reader/XLSX/RowIterator.php | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Reader/CSV/RowIterator.php b/src/Reader/CSV/RowIterator.php
index 88b7c00c..a8b3c7e6 100644
--- a/src/Reader/CSV/RowIterator.php
+++ b/src/Reader/CSV/RowIterator.php
@@ -26,7 +26,7 @@ final class RowIterator implements RowIteratorInterface
private int $numReadRows = 0;
/** @var null|Row Buffer used to store the current row, while checking if there are more rows to read */
- private ?Row $rowBuffer;
+ private ?Row $rowBuffer = null;
/** @var bool Indicates whether all rows have been read */
private bool $hasReachedEndOfFile = false;
diff --git a/src/Reader/ODS/RowIterator.php b/src/Reader/ODS/RowIterator.php
index 9bdbbd20..5a2be91f 100644
--- a/src/Reader/ODS/RowIterator.php
+++ b/src/Reader/ODS/RowIterator.php
@@ -45,7 +45,7 @@ final class RowIterator implements RowIteratorInterface
private Row $currentlyProcessedRow;
/** @var null|Row Buffer used to store the current row, while checking if there are more rows to read */
- private ?Row $rowBuffer;
+ private ?Row $rowBuffer = null;
/** @var bool Indicates whether all rows have been read */
private bool $hasReachedEndOfFile = false;
@@ -57,7 +57,7 @@ final class RowIterator implements RowIteratorInterface
private int $nextRowIndexToBeProcessed = 1;
/** @var null|Cell Last processed cell (because when reading cell at column N+1, cell N is processed) */
- private ?Cell $lastProcessedCell;
+ private ?Cell $lastProcessedCell = null;
/** @var int Number of times the last processed row should be repeated */
private int $numRowsRepeated = 1;
diff --git a/src/Reader/XLSX/RowIterator.php b/src/Reader/XLSX/RowIterator.php
index a553b8cc..44871339 100644
--- a/src/Reader/XLSX/RowIterator.php
+++ b/src/Reader/XLSX/RowIterator.php
@@ -62,7 +62,7 @@ final class RowIterator implements RowIteratorInterface
private Row $currentlyProcessedRow;
/** @var null|Row Buffer used to store the current row, while checking if there are more rows to read */
- private ?Row $rowBuffer;
+ private ?Row $rowBuffer = null;
/** @var bool Indicates whether all rows have been read */
private bool $hasReachedEndOfFile = false;