Skip to content

Commit

Permalink
fix deprecation warnings in php 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
patinthehat committed Nov 10, 2023
1 parent 31258fb commit 1413b59
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Support/Collections/Enumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ trait Enumerable
{
protected $position = 0;

#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->items[$offset]);
}

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

#[\ReturnTypeWillChange]
public function offsetSet($key, $value)
{
if (is_null($key)) {
Expand All @@ -25,31 +28,37 @@ public function offsetSet($key, $value)
}
}

#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->items[$offset]);
}

#[\ReturnTypeWillChange]
public function rewind()
{
$this->position = 0;
}

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

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

#[\ReturnTypeWillChange]
public function next()
{
++$this->position;
}

#[\ReturnTypeWillChange]
public function valid()
{
return isset($this->items[$this->position]);
Expand Down

0 comments on commit 1413b59

Please sign in to comment.