-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Fix return type docs for Mailer::send #51430
Conversation
This change is incorrect sorry. |
If you need |
In that case, the return type of Mailer::send and Mailer::sendMailable should be
|
I don't feel we should use |
I agree, so to reiterate:
In my opinion, this means that |
@driesvints why did you close this issue so quickly? Nothing has been fixed so far. Please reopen again. |
Feel free to attempt a new PR with mixed only if you really want that. |
@driesvints Why a new PR? This one can easily be adjusted. That is why I kindly ask you to reopen it. |
@simonschaufi please stop mentioning me over and over. The PR in this state is still incorrect. Feel free to send in a new one if you like. |
If Mailer::send is passed a value that implements both
Illuminate\Contracts\Mail\Mailable
andIlluminate\Contracts\Queue\ShouldQueue
, this method would return the id of the queued job (which is an int by defaut). Currently, this is not reflected in its return type. This came up in a package whereMailer
was overriden with an explicit return type, which caused the method to fail under the circumstances described above.Since
Mailer::queue
reports the return type beingmixed
, I would suggest to add that tosend
as well. However, I am aware thatmixed
would also include the other types, so it might as well just bemixed
. I am not sure if\Illuminate\Mail\SentMessage|null|mixed
or justmixed
would be the better solution in this case.