Replace ClassMetadata::getReflectionProperty with (get|set)FieldValue#3033
Replace ClassMetadata::getReflectionProperty with (get|set)FieldValue#3033Jean85 wants to merge 2 commits intodoctrine-extensions:mainfrom
ClassMetadata::getReflectionProperty with (get|set)FieldValue#3033Conversation
| $uow = $om->getUnitOfWork(); | ||
| foreach ($config['encode'] as $field => $options) { | ||
| $value = $meta->getReflectionProperty($field)->getValue($object); | ||
| $value = Meta::getProperty($meta, $field)->getValue($object); |
There was a problem hiding this comment.
The test failures around this line mean if you're going to use a static helper (which really needs to be flagged @internal), it needs to support the persistence ClassMetadata interface and not a single implementation of it. There are a lot of code paths which are supporting MongoDB ODM and ORM (this one included, see the Gedmo\Tests\Mapping\ExtensionODMTest::testGeneratedValues failure on PHP 8.5) so a bulk search/replace isn't feasible.
There was a problem hiding this comment.
Roger. I'm pushing an alternative approach, it should be enough because it relies on direct method existence checks; unfortunately the involved methods are not present in the interface.
|
@mbabker I've changed my approach as suggested, but I've discovered some additional stuff:
|
At this point I'd just change it similar to that commit/PR. After doctrine/persistence#451 |
d0916b0 to
3b3010c
Compare
ClassMetadata::getReflectionProperty with getPropertyAccessorClassMetadata::getReflectionProperty with (get|set)FieldValue
|
@mbabker I did it; the two failing tests are unrelated, I see them failing on main too, locally at least. |
9d7b9ee to
f0960ac
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3033 +/- ##
==========================================
+ Coverage 78.75% 78.82% +0.06%
==========================================
Files 169 169
Lines 8695 8688 -7
==========================================
Hits 6848 6848
+ Misses 1847 1840 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This avoids a new deprecation.
Fixes #3032