-
Notifications
You must be signed in to change notification settings - Fork 653
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
Uncaught Exception: InvalidArgumentException Could not get class storage for class-string-map #8626
Comments
Hey @yunosh, can you reproduce the issue on https://psalm.dev ? |
class-string-map is a Psalm's pseudo type that describe an array which has class-string offsets and for each offset, contains an instance of that class-string. I'm not sure why Psalm would fail to recognize it though. Do you have the latest Psalm version? Do you know what |
Yes, this is both with Psalm 4.15.0 (locally) as with the latest 4.29.0 (inside Docker container). RequestLanguageListener ist harmless: <?php
declare(strict_types = 1);
namespace XXX\EventListener;
use Symfony\Component\HttpKernel\Event\RequestEvent;
final class RequestLanguageListener
{
public function onKernelRequest(RequestEvent $event): void
{
if (!$event->isMainRequest()) {
return;
}
$request = $event->getRequest();
$request->setLocale($request->headers->get('Accept-Language', 'de-DE'));
}
} |
|
If you are talking about the Symfony container of the app that's being analyzed, this won't help, because the error even occurs if there is no container at all. |
I mean the DI container used by Symfony. Also, it would be useful to see the backtrace for this exception. |
Yes, I figured that you might talk about the Symfony container, but I still don't know which Symfony container, please see my last question. Or maybe I need to tell you more about the setup. Psalm is executed, along other checks, within a Docker container, running CaptainHook as a pre-commit hook.
|
Can you clarify what you mean by 'no container at all'? |
No Symfony DI container inside the Symfony application, i.e. if you run Psalm on the Symfony application's directory without it having warmed up the cache, and thus without having generated the container. |
I've seen something similar in #9401 |
Emitted in /Users/janschneider/.composer/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45
This is a strange class name it is looking for, obviously not from my code base.
Running psalm with --debug-by-line reveals that it stops at line 111 of a compiled Symfony container:
The text was updated successfully, but these errors were encountered: