Call to undefined method when using Nette Events
还没有人认领这个 Issue。
评估
调研方向
Start by reproducing the reported PHPStan error with the CommonTrait example, Nette 2.4, and the Nette extension. Compare the extension's handling of the SmartObject event pattern with the reported onUpdate call; done means the example no longer reports an undefined method.
由索引模型根据 Issue 内容生成。
描述
I am trying to use phpstan with nette and I have a problem with not recognizing Nette Events (even if this should be supported according to README).
My code looks like this:
trait CommonTrait
{
use SmartObject;
/** @var array */
public $onUpdate = [];
...
public function insert($data) {
...
$this->onUpdate($data);
}
But after running PHP stan with Nette extension I am getting these errors:
Call to an undefined method App\Model\Db\Languages::onUpdate()
And it is the same with other classes using this trait.
I am using Nette 2.4 and the latest PHPStan shim and I have tried that the Nette extension loads correctly.
- 主要语言
- PHP
- 星标
- 118
- 派生
- 44
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
phpstan/phpstan-nette 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
phpstan/phpstan-nette#213 ·
-
难度 4/5 3-5 天 新手友好度 35/100
phpstan/phpstan-nette#147 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 55/100
phpstan/phpstan-nette#141 · 6 条评论 ·
-
难度 4/5 3-5 天 新手友好度 20/100
phpstan/phpstan-nette#94 ·
-
难度 4/5 3-5 天 新手友好度 25/100
phpstan/phpstan-nette#82 · 3 条评论 ·
查看 phpstan/phpstan-nette 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Awaiting Triage bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
freshrss: Unable to update feeds可能已有人在做 @Stunkymonkey 今天认领。 未关闭0.kind: bug
难度 2/5 1-3 小时 新手友好度 65/100
NixOS/nixpkgs#571043 · 1 条评论 ·
维护者通常 1 天内回复
-
product / databases
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
VilnaCRM-Org/user-service#525 ·
维护者通常 21 天内回复