easyswoole3.5 模型查询后多个警告

[2024-05-24 15:40:44][trigger][notice]:[Return type of EasySwoole\ORM\AbstractModel::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at file:/www/wwwroot/swoole2.cj.zwrzsh1107.top/vendor/easyswoole/orm/src/Concern/Attribute.php line:97]

[2024-05-24 15:40:44][trigger][notice]:[Return type of EasySwoole\ORM\AbstractModel::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at file:/www/wwwroot/swoole2.cj.zwrzsh1107.top/vendor/easyswoole/orm/src/Concern/Attribute.php line:102]

[2024-05-24 15:40:44][trigger][notice]:[Return type of EasySwoole\ORM\AbstractModel::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at file:/www/wwwroot/swoole2.cj.zwrzsh1107.top/vendor/easyswoole/orm/src/Concern/Attribute.php line:113]

[2024-05-24 15:40:44][trigger][notice]:[Return type of EasySwoole\ORM\AbstractModel::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at file:/www/wwwroot/swoole2.cj.zwrzsh1107.top/vendor/easyswoole/orm/src/Concern/Attribute.php line:124]

[2024-05-24 15:40:44][trigger][notice]:[Return type of EasySwoole\ORM\AbstractModel::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at file:/www/wwwroot/swoole2.cj.zwrzsh1107.top/vendor/easyswoole/orm/src/Concern/Attribute.php line:133]

在AbstractModel加入#[\ReturnTypeWillChange] 特性来抑制警告。

/vendor/easyswoole/orm/src/AbstractModel.php

php 复制代码
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        // 方法实现
    }

    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        // 方法实现
    }


    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        // 方法实现
    }

    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        // 方法实现
    }

    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        return $this->toArray();
    }
相关推荐
黑客Ash8 分钟前
【D01】网络安全概论
网络·安全·web安全·php
->yjy9 分钟前
计算机网络(第一章)
网络·计算机网络·php
阳光帅气男孩2 小时前
PhpSpreadsheet导出图片
php
周全全2 小时前
Spring Boot + Vue 基于 RSA 的用户身份认证加密机制实现
java·vue.js·spring boot·安全·php
Mr.Pascal3 小时前
刚学php序列化/反序列化遇到的坑(攻防世界:Web_php_unserialize)
开发语言·安全·web安全·php
建群新人小猿4 小时前
会员等级经验问题
android·开发语言·前端·javascript·php
黑客Ela7 小时前
网络安全问题概述
安全·web安全·php
Wh1teR0se7 小时前
详解php://filter--理论
web安全·php
李钢蛋12 小时前
PHP函数---function_exists()详解
开发语言·php