ignore proxy object if not in hierarchy#1413
Conversation
|
@goetas Is there any change this would be merge ? Other wise I will do something else on my code base. |
|
hmm, this is weird. the uses case covered by that piece of code should handle this situation: class MyEntity
{
/**
* @Serializer\Type("SOME_INTENTIONAL_WRONG_CLASS_NAME_USED_FOR_A_TYPE_HANDLER")
*/
private OtherEntity $composition;
}So a type handler registers on if the type-hint is the same as the class name, than i'm not sure what is the expected behaviour. can you please clarify? (sorry for the late answer) |
|
The issue is that your test is done with an arbitrary string that is not a real class. My use case is with a real class that does exists 'App\DTO\OtherEntity'. Check at my PR if you want more context. After that I will also have another issue for my use case but I will open another ticket for it. (Using two different type for the same object in the same execution flow). |
|
@goetas Any decision on this ? |
This is to cover a use case like this:
Currently the code will only work if the class is not currently loaded (since the class_exists don't use the autoload). But if the class is already loaded (E.g. Second object that go trough that loop).
This give the option to create a handler on a existing class like this:
From my point of view it's a bug fix since I would have expect this to work like this but we can consider it a new feature. It should be backward compatible since nobody would have done this since the behaviour is bugged.