Closed Legion112 closed 2 years ago
good question! I don't think there is a way right now, but a PR would be welcome! We also need to narrow down exactly what is trying to connect to the DB -- it might be laravel ide helper
Hm... I got what is wrong here.
Basically the plunging not that static. It's dynamically trying to determine concrete type of container by this function.
ContainerHandler::getFunctionReturnType
.
And the interface does not allow you to throw exception here.
In case of you cannot create instance of class you should return null.
Probably it would be best if you try to catch the error and return null
Basicaly if process of creation of class would require to go to some external system for example database this this method above going to blow.
The current problme is that it going to return 0 status code if plugging throw exception while trying to get return type. I suggest to catch Throwable to eliminate chance of such error.
I tagged 2.0.1 which has this fixed in it :)
I need it in previuse laravel version? Could we add it to 1.6.*?
Describe the bug In the CI environment, we do not have a database for now. I would expect the plugin to keep working even without a database. I understand the plugin trying to get the type from schema. Is it possible to torn this off? Impacted Versions Please paste the output of
composer show | grep -E 'psalm|laravel'
so we can see what versions are impactedAdditional context Add any other context about the problem here.