Call to undefined method when using Nette Events
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- PHP
- Stars
- 118
- Forks
- 44
- Avg merge
- 17d 5h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phpstan/phpstan-nette
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
phpstan/phpstan-nette#213 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
phpstan/phpstan-nette#147 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
phpstan/phpstan-nette#141 · 6 comments ·
-
Dependency Dashboard Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
phpstan/phpstan-nette#94 ·
-
Form events errors Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
phpstan/phpstan-nette#82 · 3 comments ·
All issues in phpstan/phpstan-nette
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
coollabsio/coolify#11927 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100