全部#[\ returnTypewillChange]

发布于 2025-01-27 07:02:24 字数 810 浏览 4 评论 0原文

我正在使用旧库,这些库会丢下以下错误,

Return type of ... should either be compatible with ..., or #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

我的代码当然仍然有效,因为这并不是一个错误,只是一个折旧通知(读: https://php.watch/versions/8.1/returntypewillchange

我放置了##[\ returntypewillchange]在我的代码中,并将其置于错误中。来自我的代码。但是,我正在使用的旧库仍然会引发此错误,我找不到一种抑制它的好方法。我可以将#[\ returnTypewillChange]放在库中的代码中的所有必要位置,但是库是通过作曲家在很多计算机中,我找不到一种快速的方法来将#[\ returnTypewillChange]放置在所有计算机中!!!

有什么方法可以强迫PHP关闭returnTypewillChange来自特定库的错误?

I am using old library that throw the following error

Return type of ... should either be compatible with ..., or #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

My code still works of course, because it isn't really an error and is just a depreciation notice (read: https://php.watch/versions/8.1/ReturnTypeWillChange)

I placed #[\ReturnTypeWillChange] in my code and it supressed the error coming from my code. However, the old library i am using still throws this error and i cant find a good way to suppress it. I could place the #[\ReturnTypeWillChange] in all necessary place in the code in the library, however the library is mass installed through composer in a lot of computer, i just cant find a fast way to place #[\ReturnTypeWillChange] in all computer !!!

Is there any way to force php to shut up about the ReturnTypeWillChange error coming from a specific library ??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文