Skip to content
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

Support BackedEnum attribute typecast behaviour. #20185

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

briedis
Copy link

@briedis briedis commented Jun 4, 2024

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.

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 64.98%. Comparing base (8dacd2a) to head (0e9d2c3).
Report is 11 commits behind head on master.

Files Patch % Lines
framework/behaviors/AttributeTypecastBehavior.php 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20185      +/-   ##
============================================
- Coverage     64.99%   64.98%   -0.01%     
- Complexity    11392    11394       +2     
============================================
  Files           430      430              
  Lines         36921    36925       +4     
============================================
  Hits          23995    23995              
- Misses        12926    12930       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

'attributeTypes' => [
'status' => StatusTypeString::class,
],
'typecastBeforeSave' => true,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is needed even, because other tests may test these different events/scenarios when the casting is triggered.

@samdark samdark requested review from a team June 11, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant