False positive `Dynamic call to static method` when mixing in another class and implementing `__call` and `__callStatic`
还没有人认领这个 Issue。
评估
调研方向
Start with the linked PHPStan playground reproduction and trace the rule identified as staticMethod.dynamicCall, focusing on the interaction between mixed-in instance methods and __call/__callStatic. Done means the reported Bar::bar() false positive no longer occurs while genuine dynamic calls remain detected, with a regression test covering the example.
由索引模型根据 Issue 内容生成。
描述
When you've a class Foo that:
- provides implementations of both
__calland__callStatic, and - mixes in another class
Barthat has an instance methodbar
creating an instance of Foo and calling that instance method results in an error of the form:
Dynamic call to static method Bar::bar(). [identifier=staticMethod.dynamicCall]
Playground: https://phpstan.org/r/bfd29cdb-749b-4b97-bd50-92ecb0fcfc92
Thanks!
- 主要语言
- PHP
- 星标
- 711
- 派生
- 62
- 平均合并
- 35 分钟
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
phpstan/phpstan-strict-rules 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
phpstan/phpstan-strict-rules#317 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
phpstan/phpstan-strict-rules#316 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 45/100
phpstan/phpstan-strict-rules#289 · 1 条评论 ·
-
bug
难度 4/5 3-5 天 新手友好度 35/100
phpstan/phpstan-strict-rules#283 · 6 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
phpstan/phpstan-strict-rules#276 · 2 条评论 ·
查看 phpstan/phpstan-strict-rules 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
rap2hpoutre/fast-excel#425 ·
-
bug Medium Priority
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
sync-en
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
sync-en
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
Перевод устарел
难度 1/5 1-3 小时 新手友好度 78/100