From 2ba10df8ad5ff3ed14a2999f4b4fcbd9e9a03c14 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 23 Jul 2022 22:11:39 -0400 Subject: [PATCH] Add #[ReturnTypeWillChange] to internal PHP methods Suppress PHP 8.0+ deprecation notices from internal methods missing explicit return types. This copies "laravel/framework" 8.x file Illuminate\Database\Eloquent\Model. --- src/Model.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Model.php b/src/Model.php index cfc73a0..9e6063d 100644 --- a/src/Model.php +++ b/src/Model.php @@ -441,6 +441,7 @@ public function toJson($options = 0) * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->toArray(); @@ -863,6 +864,7 @@ public function __set($key, $value) * @param mixed $offset * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->$offset); @@ -874,6 +876,7 @@ public function offsetExists($offset) * @param mixed $offset * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->$offset; @@ -886,6 +889,7 @@ public function offsetGet($offset) * @param mixed $value * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->$offset = $value; @@ -897,6 +901,7 @@ public function offsetSet($offset, $value) * @param mixed $offset * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->$offset);