Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #260 from spatie/v2-deprecation-warnings
Browse files Browse the repository at this point in the history
V2 deprecation warnings
  • Loading branch information
brendt committed Dec 7, 2021
2 parents 009d4a6 + f7831eb commit 167ebbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.0, 7.4]
php: [8.1, 8.0, 7.4]
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
Expand Down
11 changes: 7 additions & 4 deletions src/DataTransferObjectCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ public function __get($name)
}
}

#[\ReturnTypeWillChange]
public function current()
{
return $this->iterator->current();
}

#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->iterator[$offset] ?? null;
}

public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
if (is_null($offset)) {
$this->iterator[] = $value;
Expand All @@ -53,16 +55,17 @@ public function offsetExists($offset): bool
return $this->iterator->offsetExists($offset);
}

public function offsetUnset($offset)
public function offsetUnset($offset): void
{
unset($this->iterator[$offset]);
}

public function next()
public function next(): void
{
$this->iterator->next();
}

#[\ReturnTypeWillChange]
public function key()
{
return $this->iterator->key();
Expand All @@ -73,7 +76,7 @@ public function valid(): bool
return $this->iterator->valid();
}

public function rewind()
public function rewind(): void
{
$this->iterator->rewind();
}
Expand Down

0 comments on commit 167ebbe

Please sign in to comment.