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();
    }
相关推荐
有个傻瓜30 分钟前
PHP语言核心技术全景解析
开发语言·kubernetes·php
rorg8 小时前
使用 Laravel 中的自定义存根简化工作
php·laravel
斯奕sky_small-BAD17 小时前
C++ if语句完全指南:从基础到工程实践
java·开发语言·php
Nick同学17 小时前
GatewayWorker 使用总结
后端·php
CRMEB定制开发21 小时前
CRMEB 中 PHP 快递查询扩展实现:涵盖一号通、阿里云、腾讯云
阿里云·php·腾讯云·商城系统·商城源码
CRMEB定制开发21 小时前
PHP 打印扩展开发:从易联云到小鹅通的多驱动集成实践
php·小程序源码·商城源码·微信商城·php商城源码
Bruce_Liuxiaowei21 小时前
PHP文件包含漏洞详解:原理、利用与防御
开发语言·网络安全·php·文件包含
Bruce_Liuxiaowei1 天前
深入理解PHP安全漏洞:文件包含与SSRF攻击全解析
开发语言·网络安全·php
痴人说梦梦中人1 天前
自建 dnslog 回显平台:渗透测试场景下的隐蔽回显利器
web安全·网络安全·渗透测试·php·工具
我是老孙2 天前
windows10 php报错
开发语言·php