Support BackedEnum attribute typecast behaviour.
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ✔️ |
| Breaks BC? | ❌ |
Based on the casting approach that Laravel has implemented. Not sure about validation, I think that should be implemented separately.
Codecov Report
Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
Project coverage is 64.84%. Comparing base (
65e3369) to head (4b4eb9d). Report is 5 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| framework/behaviors/AttributeTypecastBehavior.php | 0.00% | 5 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #20185 +/- ##
============================================
- Coverage 64.85% 64.84% -0.01%
- Complexity 11409 11411 +2
============================================
Files 431 431
Lines 37142 37146 +4
============================================
Hits 24087 24087
- Misses 13055 13059 +4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Any hope for this one?
@briedis can you please add a line in the changelog? Seems last thing before merging!
I added the changelog entry.
What do you think about my second commit? Renaming enum cases so they match the suggested formatting (Pascal case) as in PHP's RFC. It may feel weird, but imho it is a better approach, as enums can't be confused with constants.
I don't see an issue with that. Unless we have something implemented in the other way that can cause inconsistency. I can't think of any so I will leave for anyone who thinks otherwise before merging
@briedis thanks for your time and efforts!