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
initialization error:Could not get class storage How to solve? #7733
Comments
Hey @xiaoxuan6, can you reproduce the issue on https://psalm.dev ? |
Hi! Please run Psalm with --debug-by-line. It will show you the last line it analyzed so the code that triggered the error will be around that. Can you post it here? (Please copy/paste the whole block of code) |
vendor/bin/psalm --debug-by-line |
Can you check if you have this installed: https://github.com/psalm/psalm-plugin-laravel If not, please check it reproduces after installing, if you already have it, please try removing it and try again |
This issue happens on Symfony since #7727
|
@AndrolGenhald will you be able to take a look? |
The problem here is having multiple classes with the same FQCN and different method signatures. What exactly do we want to do in this case? I think the best thing would be to figure out which one will be autoloaded and use that, but should the other still be analyzed? I think there's a decent amount of code around that will silently fail during analysis of the duplicate class, the attributes update just changed one of those silent failures into a crash. The crashes that I ran into when debugging was due to classes being declared in vendor files that were also declared in src files, which is a bit different to conditionally declared classes but it's a similar problem. |
Yikes But if it was running silently before, we may want to emulate that. It will be icky and report weird issues or not report issues at all, but we can't really do better. Static analysis tools can't compute the kind of BC layers that assume the code is running to choose the correct class... |
$ vendor/bin/psalm --init
The text was updated successfully, but these errors were encountered: