[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();
}