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
- 分支
- 45
- 平均合併
- 10 小時 21 分鐘
- 30 天內合併 PR
- 8
環境準備
這個專案沒有提供開發容器、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 小時 新手友好度 62/100
litespeedtech/lscache_wp#1079 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 71/100
Automattic/blocks-engine#3438 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
-
bug
難度 2/5 1-3 小時 新手友好度 66/100
FriendsOfFlarum/upload#549 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
getgrav/grav-plugin-api#66 ·