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();
    }
相关推荐
残月只会敲键盘2 小时前
php代码审计--常见函数整理
开发语言·php
ac-er88883 小时前
MySQL如何实现PHP输入安全
mysql·安全·php
YUJIANYUE6 小时前
PHP将指定文件夹下多csv文件[即多表]导入到sqlite单文件
jvm·sqlite·php
龙哥·三年风水15 小时前
群控系统服务端开发模式-应用开发-个人资料
分布式·php·群控系统
Dingww101119 小时前
梧桐数据库中的网络地址类型使用介绍分享
数据库·oracle·php
Genius Kim1 天前
SpringCloud Sentinel 服务治理详解
spring cloud·sentinel·php
原机小子1 天前
城镇保障性住房管理:SpringBoot系统解决方案
数据库·spring boot·php
kali-Myon1 天前
NewStarCTF2024-Week5-Web&Misc-WP
前端·python·学习·mysql·web安全·php·web
DK七七1 天前
当今陪玩系统小程序趋势,陪玩系统源码搭建后的适用于哪些平台
小程序·php·uniapp
tekin2 天前
vscode php Launch built-in server and debug, PHP内置服务xdebug调试,自定义启动参数配置使用示例
ide·vscode·php·launch.json·runtimeargs·php内置服务自定义参数