Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Fix union type casting #185

Merged
merged 2 commits into from
Apr 14, 2021
Merged

Fix union type casting #185

merged 2 commits into from
Apr 14, 2021

Conversation

cappuc
Copy link
Contributor

@cappuc cappuc commented Apr 9, 2021

Right now properties with a union type are not supported because the resolveCasterFromType method in DataTransferObjectProperty class throw an exception in the $type->getName() call (The getName method does not exists in ReflectionUnionType.

I don't know if the solution I implemented is the best solution but in my tests it works.

@brendt brendt merged commit e50600f into spatie:master Apr 14, 2021
@brendt
Copy link
Contributor

brendt commented Apr 14, 2021

Thanks, I already had this ready in a separate branch, but I'm happy to merge your implementation :) Will tag later today

@brendt
Copy link
Contributor

brendt commented Apr 14, 2021

FYI I removed the null branch in the match block, that should never happen.

@brendt
Copy link
Contributor

brendt commented Apr 14, 2021

Tagged as 3.0.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants