[9.x] fixed issue on which class to check increment and decrement methods for custom cast - #45444
Merged
taylorotwell merged 4 commits intoJan 2, 2023
Merged
Conversation
…rement methods for custom cast
Contributor
|
Wouldn't it be better to just call the existing |
Member
Author
|
I see your point @Sjord But the I'm fine with both solutions tho. I'll just wait for someone to review it and if needed I can update it. |
Member
|
I think a test would be good here. |
taylorotwell
marked this pull request as draft
December 30, 2022 01:43
This was referenced Dec 30, 2022
Closed
sumihiran
reviewed
Dec 30, 2022
|
|
||
| $castType = $this->parseCasterClass($this->getCasts()[$key]); | ||
| if (method_exists($castType, 'castUsing')) { | ||
| $castType = $castType::castUsing([]); |
There was a problem hiding this comment.
Wouldn't calling the "castUsing" method with an empty array disregards any given cast parameters?
Member
Author
|
@taylorotwell I'll work on the test |
Member
Author
|
@taylorotwell I made some changes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix is related to the issue mentioned on #45418
The code was checking if the increment/decrement methods were available on one class but then using another class to actually call the methods. This fix is for the code to check the same class that will be called the methods.