-
-
Notifications
You must be signed in to change notification settings - Fork 100
Feature: add support for ClassLocator from doctrine/persistence 4.1 #875
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
base: 3.0.x
Are you sure you want to change the base?
Feature: add support for ClassLocator from doctrine/persistence 4.1 #875
Conversation
49caecb
to
f1befde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot for looking into this. i will have a look at the github actions, i guess we are using a too old docker image to run the tests.
identifier: property.notFound | ||
count: 1 | ||
path: ../lib/Doctrine/ODM/PHPCR/Mapping/Driver/AttributeDriver.php | ||
reportUnmatched: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need these in the baseline? can't we make sure that phpstan runs with the latest version of persistence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that a complete upgrade to doctrine/persistence 4.0
requires many more changes. The current code is made to be forward-compatible with ColocatedMappingDriver
of persistence 4.1, but the actual upgrade to this version has yet to be implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I did locally is:
- I adjusted a "require" section:
"doctrine/data-fixtures": "^1.0 || ^2.0",
"doctrine/persistence": "^3.0 || ^4.0@dev",
- Ran
AttributeDriverTest
.
At first, the tests were failing due to incompatible method / property declarations.
Those that could be easily fixed w/o breaking the current tests on persistence 3.x, I've committed.
Those that would break the tests on persistence 3.x, I've only monkey-patched locally to verify that AttributeDriverTest
works.
Therefore, current tests run on persistence 3.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, i see. so as is, these changes can not be used, its only preparation for persistence 4 compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes will kick in once persistence 4 comes into play
i fixed the CI setup, please rebase this branch on 2.0.x i updated phpstan to run on php 8.4, maybe that solves the issue with the persistance false alerts? |
6ea264a
to
643d4df
Compare
These changes are the first of migration toward doctrine/persistence 4.0. Most of the signatures that could've been made compatible have been made compatible. There are some other, which require more in-depth knowledge of repository to adjust / rework.
These changes integrate doctrine/persistence#433 `ClassLocator` allows clients to pass any iterable of classes they might want.
643d4df
to
dc1b028
Compare
tests seem green now. should i merge so that we have this part of the work to upgrade? for full compatibility, further work is needed. |
I'm wondering which version this should be merged into, since the full upgrade toward 4.0 persistence would require BC breaks. Actually, these changes to the signatures themselves are BC breaks. |
oh indeed. i can create a 3.x branch if you want. |
It would be more correct, yet it's all up to you |
i created the 3.0.x branch. can you edit the target of this PR? my idea for supporting older versions (of the base doctrine libs) is: as long as its only very small effort and does benefit users (e.g. keep supporting older PHP versions) we should. but if it becomes an obstacle, either a lot of effort, or ugly solutions, or not fully profiting from the new features of the base libs, we should ditch old versions. |
The changes integrate a forward compatibility support for doctrine/persistence#433
ClassLocator
, which allows clients to pass any iterable of classes they might want.Parallel PRs for:
ClassLocator
orm#12131Note that it doesn't provide full support for persistence 4.x, but instead implements
AttributeDriver
, while also adjusting some signatures to achieve compatibility with 4.x.