Skip to content

[Mime] Allow to add some headers as a strings #51601

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

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Conversation

Oipnet
Copy link
Contributor

@Oipnet Oipnet commented Sep 8, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Tickets Fix #51584
License MIT

When adding a MailboxListHeader header, the constructor expects an array as parameter.

To simplify the UX, we now allow you to pass a string to the addHeader method in the case of a MailBoxListHeader. The header value is then converted to an array.

@carsonbot carsonbot added this to the 6.4 milestone Sep 8, 2023
@xabbuh xabbuh added the Mime label Sep 12, 2023
@carsonbot carsonbot changed the title symfony/mime does not allow to add some headers as a strings [Mime] symfony/mime does not allow to add some headers as a strings Sep 12, 2023
@derrabus
Copy link
Member

derrabus commented Sep 13, 2023

Thank you.

We don't allow merge commits. Please perform a rebase and squash your commits.

@AurelienPillevesse
Copy link
Contributor

AurelienPillevesse commented Sep 14, 2023

In addition to the !is_array verification, verifying that it's a string should be added no?
What do you think about it ?

@Oipnet
Copy link
Contributor Author

Oipnet commented Sep 18, 2023

@AurelienPillevesse

When something other than a string is passed, the message seems rather explicit.

Argument #2 ($value) must be of type string, DateTime given

What do you think should happen if you don't have a string?

@derrabus
Copy link
Member

When something other than a string is passed, the message seems rather explicit.

Argument #2 ($value) must be of type string, DateTime given

This is fine, I think.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

can you please update the PR title (+ commit title) so that it's turned into a positive sentence about what this does?

@Oipnet Oipnet changed the title [Mime] symfony/mime does not allow to add some headers as a strings [Mime] Allow to add some headers as a strings Sep 19, 2023
@nicolas-grekas
Copy link
Member

Thank you @Oipnet.

@nicolas-grekas nicolas-grekas merged commit 18685c4 into symfony:6.4 Sep 20, 2023
This was referenced Oct 21, 2023
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.

symfony/mime does not allow to add some headers as a strings, only as arrays
7 participants