Skip to content

Commit

Permalink
PHP 8.1 Fixes (#45)
Browse files Browse the repository at this point in the history
* support PHP 8.1

* Update phpunit.xml.dist

Co-authored-by: Graham Campbell <GrahamCampbell@users.noreply.github.com>
  • Loading branch information
tianyiw2013 and GrahamCampbell committed Feb 8, 2022
1 parent 04b06e7 commit 9cd7176
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="true"
colors="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
colors="true"
bootstrap="vendor/autoload.php"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite name="unit">
Expand Down
6 changes: 6 additions & 0 deletions src/HasDataTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,37 @@ public function __debugInfo()
return $this->data;
}

#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return array_key_exists($offset, $this->data);
}

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

#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->data[$offset] = $value;
}

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

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

#[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->data);
Expand Down

0 comments on commit 9cd7176

Please sign in to comment.