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();
    }
相关推荐
郑州光合科技余经理1 小时前
技术视角:海外版一站式同城生活服务平台源码解析
java·开发语言·uni-app·php·排序算法·objective-c·生活
郑州光合科技余经理1 小时前
海外版生活服务系统源码 | 外卖+跑腿一站式平台技术解析
java·开发语言·javascript·git·spring cloud·php·生活
catchadmin3 小时前
告别 Shell 脚本:用 Laravel Envoy 实现干净可复用的部署
php·laravel
云和数据.ChenGuang4 小时前
Zabbix 6 与 PHP 5 版本**完全不兼容
运维·开发语言·php·zabbix·运维工程师
小白勇闯网安圈5 小时前
bug、Confusion1、ics-07、
网络安全·php·web
呆萌小新@渊洁5 小时前
Linux离线环境安装ffmpeg
linux·ffmpeg·php
WordPress学习笔记6 小时前
什么是functions.php文件?
开发语言·php·wordpress
云和数据.ChenGuang6 小时前
运维工程师技术之nginx搭配php
运维·nginx·php·运维技术·数据库运维工程师·运维教程
BingoGo6 小时前
PHP 8.5 垃圾回收改进
后端·php
树下水月6 小时前
下载PHP 的历史版本
开发语言·php