Skip to content

Update return types to silence deprecation notices with PHP 8.1 #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ public function toArray()
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->toArray();
Expand All @@ -330,7 +331,7 @@ public function jsonSerialize()
*
* @return bool
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return !is_null($this->getAttribute($offset));
}
Expand All @@ -342,6 +343,7 @@ public function offsetExists($offset)
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->getAttribute($offset);
Expand All @@ -355,7 +357,7 @@ public function offsetGet($offset)
*
* @return void
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
$this->setAttribute($offset, $value);
}
Expand All @@ -367,7 +369,7 @@ public function offsetSet($offset, $value)
*
* @return void
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
unset($this->attributes[$offset]);
}
Expand Down