From e494478af24470d8051bc7244833f1056378d0b7 Mon Sep 17 00:00:00 2001 From: Andreas Date: Fri, 22 Apr 2022 20:26:26 +0200 Subject: [PATCH] Avoid deprecation notices in PHP 8.1 (#58) --- src/Message.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Message.php b/src/Message.php index 7b5c52d..04a71dd 100644 --- a/src/Message.php +++ b/src/Message.php @@ -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]);