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();
    }
相关推荐
ljh57464911915 小时前
PHP password_verify() 函数
开发语言·php
Kyln.Wu19 小时前
【python实用小脚本-139】Python 在线图片批量下载器:requests+PIL 一键保存网络图像
数据库·python·php
zorro_z1 天前
PHP语法高级篇(二):文件处理
php
SuperherRo1 天前
Web攻防-PHP反序列化&原生内置类&Exception类&SoapClient类&SimpleXMLElement
php·xss·反序列化·exception·ssrf·原生类·soapclient
阿维的博客日记1 天前
TCP和UDP区别
tcp/ip·udp·php
MZ_ZXD0011 天前
flask校园学科竞赛管理系统-计算机毕业设计源码12876
java·spring boot·python·spring·django·flask·php
Q_Q19632884751 天前
python的平安驾校管理系统
开发语言·spring boot·python·django·flask·node.js·php
是阿建吖!2 天前
【Linux | 网络】应用层
linux·网络·php
夏至春来-美美2 天前
php绘图添加水印,文字使用imagick库的操作
php
果子⌂2 天前
Docker高级管理
开发语言·docker·云计算·php