Remove dependency to doctrine/common#299
Conversation
|
The code does not properly handle cases where code implements the Proxy interface without the future methods |
I see several paths forward:
What would you recommend? I'm leaning towards 3. |
d0ea640 to
51ba295
Compare
|
I went ahead and implemented a check, but just for the methods that are called. |
|
It's been a while since I had to touch proxied-public-properties-voodoo magic but here goes nothing: can't we outsource the optimization to doctrine/common and/or employ consumers (well, ORM) to do some check beforehand and remove code altogether? Given ORM is the only consumer, and it already relies on doctrine/common, it could even provide its own implementation for needed reflection. |
|
@malarzm no idea yet, but it sounds better indeed, I'll try to look into that 👍 |
|
@malarzm I've taken a look at ORM, and I think one way to do this in a simple way would be to override @derrabus @beberlei what do you think about this? It should be noted that if we decide to go that way, we will have to deprecate passing a proxy object to |
51ba295 to
5c2bb32
Compare
|
GetValue is Performance critical, i would like to avoid to increase the number of method calls there. |
|
I need to look at this on a proper display, on mobile i cant fully review |
|
Here goes nothing |
|
@malarzm it's already in |
Oh, missed that. What's the point then? Once we get rid of old Proxies in ORM (and enough time passes) we'll be able to just get rid of it. What's the benefit now? |
|
|
Shouldn't ORM switch to ProxyManager first and continue PHP 8 syntax afterwards? Then |
This comment says we shouldn't: doctrine/orm#8518 (comment)
Can't we? If we copy proxy classes to the ORM, maybe we can? |
All right, had no idea it was the plan :) |
Two good reasons to do this move: - This was a circular dependency. - doctrine/common is being sunset.
5c2bb32 to
94408fb
Compare
|
Converting to draft as determining how to replace |
|
See follow up at #307 |
| return; | ||
| } | ||
|
|
||
| if (! method_exists($object, '__getInitializer') || ! method_exists($object, '__setInitializer')) { |
There was a problem hiding this comment.
Couldn't we assume that $object is always an isntance of the class used for this property and move the check to ctor?
There was a problem hiding this comment.
Ah yes that's probably safe to do 👍
|
@greg0ire Generally |
|
Replaced by #368 |
Two good reasons to do this move: