Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to protected or private method using param-closure-this should be allowed #11154

Closed
bastien-phi opened this issue Jun 6, 2024 · 1 comment

Comments

@bastien-phi
Copy link

Bug report

When binding $this to a class in closures using @param-closure-this, it should be allowed to call protected or private methods of the class as it is valid php code.

Code snippet that reproduces the problem

https://phpstan.org/r/74150e1e-4c8f-48e3-b56b-9f246558e529

Expected output

No errors on the $this->sayHello() and the $this->wisper() calls

Did PHPStan help you today? Did it make you happy in any way?

An analysis a day keeps the doctor away ! (but more than just 1 is better)

@ondrejmirtes
Copy link
Member

This needs another PHPDoc tag for setting closure scope. Duplicate of #11010.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants