-
Notifications
You must be signed in to change notification settings - Fork 590
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
Add support for model keys cast to backed enums in FormatModel #1286
Conversation
This will probably break support for PHP < 8.1. I'm not sure how compatibility is handled in this project, any help would be greatly appreciated. |
We can't break apps on <8.1. 7.3 is the minimum version right now. You'll need to do a class_exists check I think. |
Updated. The reasoning is, if the |
I have just noticed also, it might be worthwhile to implement a similar check on the case at line 18. Let me know if that makes sense and I will refactor the whole thing to include all cases. |
Line 18 seems fine to me. |
I meant the block fulfilling the condition on line 18, specifically line 20 and 21. In that case, In any case, I have provided the more complete solution that should take care of either case. LMK if you see any issues. |
As the title states, add support for model keys cast to backed enums in FormatModel. I have not scouted the whole codebase, there may be other places where a fix is needed to support backed enums for model keys.
I came across this bug while working on a project of mine. I had left this project alone for a couple of weeks before resuming it today. The issue didn't happen before, and I did a
composer update
when resuming, so this might be a regression. I, unfortunately, do not have the time to check more thoroughly.Hope this helps. Thank you.