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();
    }
相关推荐
ALex_zry1 小时前
Docker Macvlan网络配置实战:解决“network already exists“错误
网络·docker·php
布尼卡2 小时前
mac brew 无法找到php7.2 如何安装php7.2
php·mac
ALe要立志成为web糕手3 小时前
[BJDCTF2020]EzPHP
web安全·网络安全·php·ctf
农民也会写代码4 小时前
dedecms织梦arclist标签noflag属性过滤多个参数
开发语言·数据库·sql·php·dedecms
Zhuai-行淮6 小时前
施磊老师基于muduo网络库的集群聊天服务器(七)
服务器·网络·php
言之。12 小时前
别学了,打会王者吧
java·python·mysql·容器·spark·php·html5
帅云毅20 小时前
文件上传--解析漏洞和编辑器
笔记·学习·安全·web安全·编辑器·php
wt_cs20 小时前
身份证实名认证接口数字时代的信任基石-node.js实名认证集成
开发语言·node.js·php
胡译胡说1 天前
PHP核心开发者Nikita的首次提交,就实现了个寂寞啊
php
老李不敲代码1 天前
榕壹云预约咨询系统:基于ThinkPHP+MySQL+UniApp打造的灵活预约小程序解决方案
mysql·微信小程序·小程序·uni-app·php