From 6199744ba52cdc46e329ddadb923460ca182b854 Mon Sep 17 00:00:00 2001 From: Erin Hastings Date: Sun, 8 May 2022 10:05:56 -0500 Subject: [PATCH 1/2] Update ArrayAccess method return types for PHP 8.1 compatibility --- src/Model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Model.php b/src/Model.php index ff67cbe..ee37560 100755 --- a/src/Model.php +++ b/src/Model.php @@ -330,7 +330,7 @@ public function jsonSerialize() * * @return bool */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return !is_null($this->getAttribute($offset)); } @@ -342,6 +342,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->getAttribute($offset); @@ -355,7 +356,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->setAttribute($offset, $value); } @@ -367,7 +368,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->attributes[$offset]); } From 7997e39d96ada30cae39a123aaa9bac295afa339 Mon Sep 17 00:00:00 2001 From: Erin Hastings Date: Thu, 2 Jun 2022 14:44:16 -0500 Subject: [PATCH 2/2] Update JsonSerializable method return type for PHP 8.1 compatibility --- src/Model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model.php b/src/Model.php index ee37560..7e30b0e 100755 --- a/src/Model.php +++ b/src/Model.php @@ -318,6 +318,7 @@ public function toArray() * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->toArray();