-
Notifications
You must be signed in to change notification settings - Fork 43
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
Configuration loading #10
Comments
Limitation: only XML mapping is supported. Annotations require more work, and YAML mapping requires test infra support. Refs #10
@ weirdan Can you please describe in more details? |
@weirdan some why you have not been mentioned |
phpstan-doctrine allows providing an |
@iluuu1994 I think those comments mean that @weirdan doesn't want to load whole application in order to get entity manager. But on the other hand, I'm more on the @iluuu1994 side, only the real entity manager can tell us real return types. And it will also be able to parse and validate DQL. On the other hand, it will be dynamic code analysis ( nothing bad, but its not SA anymore) @weirdan can you please explain your POV |
@vladyslavstartsev
Yeah but it could also be opt-in. If you want more accurate analysis you'd need to provide a real
|
Doctrine has a static metadata driver / reflection component where you can read the configuration almost without executing code, only reading the configuration. You can look at the EntityGenerator or Convert Database to Entity commands to see how to use them. If you go low level enough, you don't need the EntityManager as far as i remember. Another option that the Symfony psalm plugin uses is to load the "cached" metadata (or cahced container.xml in that case). Doctrine writes configuration to the cache as serialized class metadata. You could load that without needing much of anything runtime doctrine code. |
I should probably mention it here |
Hi @weirdan just wanted to ask whether you have some spare time for this in the near future. Thanks! |
Unlikely to happen anytime soon. |
This plugin needs to be able to load doctrine configuration for functionality like checking entity types, findBy* methods, etc.
Requires:
The text was updated successfully, but these errors were encountered: