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();
    }
相关推荐
jingyu飞鸟4 小时前
Centos7系统(最小化安装)安装zabbix7版本详细文章、nginx源代码配置、php源代码、mysql-yum安装
开发语言·php
Q_Q19632884755 小时前
python的家教课程管理系统
开发语言·spring boot·python·django·flask·node.js·php
lanbing7 小时前
PHP 与 面向对象编程(OOP)
开发语言·php·面向对象
zm14 小时前
TCP 粘包
服务器·网络·php
Le_ee19 小时前
sqli-labs靶场第七关——文件导出注入
数据库·sql·网络安全·php·sql注入·sqli—labs
zm20 小时前
UDP 多点通信
开发语言·php
*neverGiveUp*21 小时前
PHP基础知识
开发语言·php
绵山介子推1 天前
IP地址、端口、TCP介绍、socket介绍、程序中socket管理
网络协议·tcp/ip·php·嵌入式软件
sadoshi1 天前
phpstudy的Apache添加AddType application/x-httpd-php .php .php5配置无效的处理方式
开发语言·php·apache
s_little_monster1 天前
【Linux】socket网络编程基础
linux·运维·网络·笔记·学习·php·学习方法