-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[11.x] Applying value
Function into the $default
value of transform
helper
#52510
[11.x] Applying value
Function into the $default
value of transform
helper
#52510
Conversation
Would this be considered a breaking change? |
I strongly believe not, since both |
Only if someone is expecting the Which, IMO, is highly unlikely. |
@taylorotwell actually this is unneeded, re-reading my comment, I fell I oversaw it. The framework/src/Illuminate/Support/helpers.php Lines 468 to 479 in 81a0b5b
The line modified in this PR only adds a function call to the stack call, as // $default is never a callable here
return value($default); Other than the useless function call, there is no harm in keeping it, so I didn't send a PR to revert it. |
We're not just talking about callables. |
Just to be clear, you did check the framework/src/Illuminate/Collections/helpers.php Lines 234 to 237 in 81a0b5b
If the As the
Now you let me curious, I guess we mutually agree that in the modified line, So, what are you talking about, then? |
The
$default
value of thetransform
function does not pass through thevalue
to allow the execution of a closure to obtain the default value, for example. This PR fixes this by passing$default
through thevalue
helper.