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
PHP 8.2 - Phpstan - Does not scan laravel ide helper model #8566
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
You probably need to add generated file(s) into |
@karinarastsinskagia How does the generated file look like? It needs to have |
I already use
Please find below how my includes: parameters:
|
Classes are allowed to have dynamic properties with |
I have already tried to use Has anyone dealt with a similar case? |
Please create a small reproducing repository that shows the problem. |
Please find below an example of this issue https://phpstan.org/r/a99c90c0-488e-4105-8955-451ce8a77c36 As I said earlier, I am using |
My suggestion works: https://phpstan.org/r/cbc4611b-f6d6-4dc3-8bba-bb5f01dc867c |
Is there any other solution ? Is it possible some of the |
Your code can't work on PHP 8.2 (throws deprecation warnings) unless you allow dynamic properties with When I try to run your original code on PHP 8.2, it throws deprecation warnings, which matches what PHPStan reports: https://3v4l.org/FbLAg |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
Probably similar to #8550, on PHP 8.2, when a dynamic property is documented in laravel ide helper model with @Property annotation, an
Access to an undefined property
is thrown. It seems that phpstan does not scan ide_helper_models script and does not recognize these properties.If I put all these @Property annotations to the respective class directly, the problem disappears. However, this does not solve the real issue.
Also, I noticed that if I customize my ruleset-phpstan.neon file and add the following parameter everything works fine.
phpVersion: 80100 # PHP 8.1
So, phpstan is not compatible with laravel ide helper?
Code snippet that reproduces the problem
Expected output
No errors!
Did PHPStan help you today? Did it make you happy in any way?
The text was updated successfully, but these errors were encountered: