-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Envelope incorrectly processes Address object #50430
Comments
This seems to be intentional. The The actual processing happens in normalizeAddresses(), which is also built around the expectation that those properties should be passed as arrays. I agree, though, that it should be possible to pass a simple |
Agreed.
Or enforce types on the constructor, although this could be breaking change for some apps. |
fixes #50430 Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
After further investigation, this seems to be more of docblock improvement. |
Hey there, thanks for reporting this issue. If you notice improper DocBlock, PHPStan, or IDE warnings while using Laravel, do not create a GitHub issue. Instead, please submit a pull request to fix the problem. Also see our contribution guide. Thanks! |
I disagree with your interpretation. This is not a docblock issue, and by stating that the recipients can be instances of Address you have compounded the issue. The issue is that recipients CANNOT be a single address instance since normalizeAddresses will iterate over the address object and create two new Address objects only one of which is valid. Second opinion requested. |
The docblock of |
fixes #50430 Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Laravel Version
10.47.0
PHP Version
8.2.16
Database Driver & Version
No response
Description
passing a single Address object into Envelope causes two Address objects being created, with the second having the name as the email address and causing a malformed email address error
Steps To Reproduce
Reproduced in Tinkerwell
Creating an Address object
results in
A seemingly correct Address object with address and name correctly assigned
However, pass this object into the envelope;
results in the two properties of Address to be turned into two separate Address objects
I suspect this could be a quite common issue, but with devs finding some alternate syntax that works for them, such as wrapping the address in an array;
correctly gives
The text was updated successfully, but these errors were encountered: