8000 bug #37167 [Mime] use fromString when creating a new Address (fabpot) · symfony/symfony@5b719d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b719d1

Browse files
committed
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
2 parents 749380a + de68787 commit 5b719d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Mime/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static function create($address): self
8989
return $address;
9090
}
9191
if (\is_string($address)) {
92-
return new self($address);
92+
return self::fromString($address);
9393
}
9494

9595
throw new InvalidArgumentException(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

Comments
 (0)
0