-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mime] Remove @internal from Headers methods #40576
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
Conversation
Could you elaborate why you want them to be not internal? What is your scenario where these methods are the only solution? |
Sure, I followed the recommendation #40056 (comment) and implemented my own mailchimp mailer with more configuration options. When I create the payload, it requires at least the same data than the one symfony is building in https://github.com/symfony/mailchimp-mailer/blob/a6c3fa9aeaf83ad79445c9e7c072e15288bea3c9/Transport/MandrillApiTransport.php#L73 If I want to reproduce the same behavior, I don't have any other options to get the |
Thank you. I appreciate the context. I don't think this is a bug fix. It is a feature that we are making methods non-internal. Ie we should target 5.x. I'll wait for a review from someone with better understanding of the Mime component. |
I agree, but I would go to merge this as a bugfix, because it just removes an annotation and opens sth instead of closing. 👍 for a bugfix |
I consider this the same as making a private function public. Ie, we add a new function to the public API, hence a feature. But Im not sure how we usually do in scenarios like this. |
The code in the 4.4 branch and the 5.x one for these internal methods are the same, so it won't hurt to merge it on 4.4. But I understand if you prefer to merge this on 5.x, I'll just ignore the error until the next version. Not a big deal. |
friendly ping @nicolas-grekas for a decision 😍 |
That's a new feature for sure: it will deserve dedicated changlog line + tests + doc. |
4aeca5c
to
7f2b7a3
Compare
IIUC the intended public API is edit: oh Headers has zero inheritance 👍 i agree this API is less boring. |
For instance, the |
What about keeping the setter as internal, but not the getters ? |
7f2b7a3
to
b48ec76
Compare
PR was updated to only remove @internal on the getters. |
UPGRADE-5.3.md
Outdated
Mime | ||
---- | ||
|
||
* Remove internal annotation to the method `getHeaderBody` and `getHeaderParameter`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] from the [...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a second to that should be replaced with from :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe reword it like this:
Remove the internal annotation from the
getHeaderBody()
andgetHeaderParameter()
methods of theHeaders
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
b48ec76
to
773a12b
Compare
ac1946a
to
7eacdf7
Compare
7eacdf7
to
592fb13
Compare
Thank you @VincentLanglet. |
I don't understand why the methods
Headers::getHeaderBody()
Headers::setHeaderBody()
Headers::getHeaderParameter()
Headers::setHeaderParameter()
are marked as internal.
They are already used by others libraries, like
https://github.com/symfony/mailchimp-mailer/blob/a6c3fa9aeaf83ad79445c9e7c072e15288bea3c9/Transport/MandrillApiTransport.php#L92
https://github.com/symfony/mailchimp-mailer/blob/a6c3fa9aeaf83ad79445c9e7c072e15288bea3c9/Transport/MandrillApiTransport.php#L99
The implementation shouldn't change so they could be under the BC promise.
Plus they are useful, and I don't see any other way that reimplementing the method if we want to do something like