You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The when() method accepts a value it will use as condition. It would be great to be able to access this value in the callback as argument as it's more common to do something like $mail->when($user->email, fn($mail, $email) => $mail->to($email)) then using empty() function or call the value retriever again in the callback.
Because we already pass the instance when() is called on as first argument and this change shouldn't be breaking we should pass the value as second argument to the callback. As PHP ignores additional arguments this change isn't breaking.
This should only be applied to the callback way and not the higher-order-proxy as we have no idea to which argument we should pass the value and this could also be breaking.
The text was updated successfully, but these errors were encountered:
The
when()
method accepts a value it will use as condition. It would be great to be able to access this value in the callback as argument as it's more common to do something like$mail->when($user->email, fn($mail, $email) => $mail->to($email))
then usingempty()
function or call the value retriever again in the callback.Because we already pass the instance
when()
is called on as first argument and this change shouldn't be breaking we should pass the value as second argument to the callback. As PHP ignores additional arguments this change isn't breaking.This should only be applied to the callback way and not the higher-order-proxy as we have no idea to which argument we should pass the value and this could also be breaking.
The text was updated successfully, but these errors were encountered: