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
bug #37167 [Mime] use fromString when creating a new Address (fabpot)
This PR was merged into the 4.4 branch.
Discussion
----------
[Mime] use fromString when creating a new Address
| Q | A
| ------------- | ---
| Branch? | 4.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | n/a <!-- prefix each issue number with "Fix #", if any -->
| License | MIT
| Doc PR | n/a
When creating an Address, there are two ways right now in 4.4: `Address::create()` which takes an email or an instance of Address and `Address::fromString()` which takes an email or an email+name.
In 4.4, I propose to make `create` supports everything possible. And in 5.2, I will probably propose to deprecate `fromString()`.
Commits
-------
de68787 [Mime] use fromString when creating a new Adress
Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/Address.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ public static function create($address): self
89
89
return$address;
90
90
}
91
91
if (\is_string($address)) {
92
-
returnnewself($address);
92
+
returnself::fromString($address);
93
93
}
94
94
95
95
thrownewInvalidArgumentException(sprintf('An address can be an instance of Address or a string ("%s") given).', \is_object($address) ? \get_class($address) : \gettype($address)));
0 commit comments