-
Notifications
You must be signed in to change notification settings - Fork 103
[PoC] Resolve custom repository classes #18
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
Conversation
Hi, |
Thinking ahead of time: Since this repository is generically for
and the code in this PR look quite ORM-specific right now. |
@Majkl578 very valid points! That's why it was proof of concept only ;)
I assumed that
another approach could be to infer whether classes are designed for ORM or ODM by looking at provided mapping/annotation in classes.
Easiest would be versioning - v1 of the plugin requiring ORM 2 and next version for ORM 3. Also depending on the number of breaks the plugin itself could provide a compatibility layer for metadata it needs and avoid major version bump. With ODM it'll be a bit easier as we do not aim to break mapping stuff just yet. |
I'm not well acquainted with the PHPStan code, but is not it enough to replace |
@ossinkine Definitely not 😊 |
Superseded by #49. |
This is only a proof of concept, has some rough edges (including CS) and obviously needs tests. FWIW it does work :) I'm opening this PR to see whether such approach would be accepted to not waste time.
Motivation behind creating dummy entity manager is that we get support for all mapping formats out of the box and don't need to resolve mappings on our own. With this we'll be able to get same mappings as Doctrine has so it opens possibilities to more checks.
Example of configuration: