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();
    }
相关推荐
Book_熬夜!9 分钟前
Python基础(九)——正则表达式
python·正则表达式·php
计算机学姐1 小时前
基于PHP的电脑线上销售系统
开发语言·vscode·后端·mysql·编辑器·php·phpstorm
BLEACH-heiqiyihu1 小时前
红帽9中nginx-源码编译php
运维·nginx·php
翔云API2 小时前
人证合一接口:智能化身份认证的最佳选择
大数据·开发语言·node.js·ocr·php
白总Server2 小时前
MongoDB解说
开发语言·数据库·后端·mongodb·golang·rust·php
fakaifa3 小时前
八戒农场小程序V2最新源码
小程序·uni-app·php·生活·开源软件
吱吱鼠叔4 小时前
MATLAB方程求解:1.线性方程组
开发语言·matlab·php
Messiah___4 小时前
【论文阅读】Slim Fly: A Cost Effective Low-Diameter Network Topology 一种经济高效的小直径网络拓扑
开发语言·php
项目題供诗7 小时前
尚品汇-秒杀商品存入缓存、Redis发布订阅实现状态位(五十一)
开发语言·php
蜗牛沐雨8 小时前
用 ReactPHP 实现图片上传加速:让并发上传实现真正的高效
php·reactphp