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 deprecated warnings for SpreadsheetReader.php #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 11 additions & 11 deletions src/SpreadsheetReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function __construct(\SplFileObject $file, $headerRowNumber = null, $acti
/**
* @return int
*/
public function count()
public function count(): int
{
$count = count($this->worksheet);
if (null !== $this->headerRowNumber) {
Expand All @@ -122,7 +122,7 @@ public function count()
*
* @author Derek Chafin <[email protected]>
*/
public function current()
public function current(): mixed
{
$row = $this->worksheet[$this->pointer];

Expand All @@ -141,7 +141,7 @@ public function current()
*
* @return array
*/
public function getColumnHeaders()
public function getColumnHeaders(): array
{
return $this->columnHeaders;
}
Expand All @@ -153,7 +153,7 @@ public function getColumnHeaders()
*
* @return array
*/
public function getRow($number)
public function getRow(int $number): array
{
$this->seek($number);

Expand All @@ -163,9 +163,9 @@ public function getRow($number)
/**
* Return the key of the current element
*
* @return int
* @return int|null scalar on success, or null on failure.
*/
public function key()
public function key(): mixed
{
return $this->pointer;
}
Expand All @@ -175,7 +175,7 @@ public function key()
*
* @return void Any returned value is ignored.
*/
public function next()
public function next(): void
{
$this->pointer++;
}
Expand All @@ -189,7 +189,7 @@ public function next()
*
* @return void Any returned value is ignored.
*/
public function rewind()
public function rewind(): void
{
if (null === $this->headerRowNumber) {
$this->pointer = 0;
Expand All @@ -207,7 +207,7 @@ public function rewind()
*
* @return void Any returned value is ignored.
*/
public function seek($pointer)
public function seek(int $pointer): void
{
$this->pointer = $pointer;
}
Expand All @@ -219,7 +219,7 @@ public function seek($pointer)
*
* @return void Any returned value is ignored.
*/
public function setColumnHeaders(array $columnHeaders)
public function setColumnHeaders(array $columnHeaders): void
{
$this->columnHeaders = $columnHeaders;
}
Expand All @@ -243,7 +243,7 @@ public function setHeaderRowNumber($rowNumber)
* @return bool The return value will be casted to boolean and then evaluated.
* Returns true on success or false on failure.
*/
public function valid()
public function valid(): bool
{
return isset($this->worksheet[$this->pointer]);
}
Expand Down