Skip to content
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

[Mime] Remove NamedAddress #33270

Merged
merged 1 commit into from Aug 21, 2019
Merged

[Mime] Remove NamedAddress #33270

merged 1 commit into from Aug 21, 2019

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Aug 21, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

While working on #33091, we realizes that having both NamedAddress and Address brings some unneeded complexity. Initially, I added both as some headers do not support NamedAddresses. But the code already does the right thing by "downgrading" them to Address instances. So, let's simplify our internal code and make life easier for our users too.

fabpot added a commit that referenced this pull request Aug 21, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Remove NamedAddress

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | yes     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

While working on #33091, we realize that having both `NamedAddress` and `Address` brings some unneeded complexity. Initially, I added both as some headers do not support `NamedAddress`es. But the code already does the right thing by "downgrading" them to `Address` instances. So, let's simplify our internal code and make life easier for our users too.

Commits
-------

eb7d74e [Mime] Remove NamedAddress
@fabpot fabpot merged commit eb7d74e into symfony:4.4 Aug 21, 2019
@@ -93,15 +90,15 @@ public function getReturnPath(): string
/**
* @return $this
*/
public function addFrom(string $address, string $name = null): self
public function addFrom(string $address, string $name = ''): self
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be documented in the upgrade guide too, as the parameter type changed from string|null to string, which is also a BC break.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter type was string and null was only to express that no arguments was passed. Anyway, I think that's minor and we should not waste our time on such things.

@@ -21,14 +21,15 @@
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
class Address
final class Address
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be documented in the upgrade guide too, as it is a BC break.

@@ -61,7 +68,7 @@ public function getEncodedAddress(): string

public function toString(): string
{
return $this->getEncodedAddress();
return ($n = $this->getName()) ? $n.' <'.$this->getEncodedAddress().'>' : $this->getEncodedAddress();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $this->name directly rather than adding another variable.

@fabpot fabpot deleted the named-address-removal branch September 6, 2019 10:41
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Oct 18, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer][Mime] NamedAddress was removed in 4.4

It was removed in 4.4 (symfony/symfony#33270) in favor of using Address with a second arg.

Commits
-------

9b6eb23 [Mailer][Mime] NamedAddress was removed in 4.4
fabpot added a commit that referenced this pull request Oct 18, 2019
…(ogizanagi)

This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer][MailchimpBridge] Fix NamedAddress obsolete paths

| 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

As NamedAddress was removed in #33270 (4.4) and this bridge does require `symfony/mailer >= 4.4`.

Commits
-------

f14d082 [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants