Skip to content

Commit

Permalink
Avoid deprecation notices in PHP 8.1 (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
iquito authored Apr 22, 2022
1 parent 4d6d955 commit e494478
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,31 @@ public function __construct(array $data)
$this->data = $data;
}

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

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

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

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

#[\ReturnTypeWillChange]
public function offsetUnset($key)
{
unset($this->data[$key]);
Expand Down

0 comments on commit e494478

Please sign in to comment.