Skip to content

Commit

Permalink
Merge pull request #5 from geo0000/feature/fix-php81-plus-notice
Browse files Browse the repository at this point in the history
Fix notices about some ArrayAccessTrait methods for PHP 8.1+
  • Loading branch information
seboettg authored Jul 9, 2022
2 parents b41f003 + 631f01a commit 6f753ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ArrayList/ArrayAccessTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ trait ArrayAccessTrait
/**
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->array);
Expand All @@ -35,6 +36,7 @@ public function getIterator()
*
* @return mixed Can return all value types.
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->array[$offset]) ? $this->array[$offset] : null;
Expand All @@ -46,6 +48,7 @@ public function offsetGet($offset)
* @param mixed $offset The offset to assign the value to.
* @param mixed $value The value to set.
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->array[$offset] = $value;
Expand All @@ -58,6 +61,7 @@ public function offsetSet($offset, $value)
* @param mixed $offset
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->array[$offset]);
Expand All @@ -68,6 +72,7 @@ public function offsetExists($offset)
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @param mixed $offset The offset to unset.
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->array[$offset]);
Expand All @@ -76,6 +81,7 @@ public function offsetUnset($offset)
/**
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->array);
Expand Down

0 comments on commit 6f753ae

Please sign in to comment.