Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mime] Remove @internal annotations for the serialize methods#32302
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
nicolas-grekas approved these changesJul 3, 2019
fabpot approved these changesJul 3, 2019
Member
fabpot commentedJul 3, 2019
Thank you@francoispluchino. |
fabpot added a commit that referenced this pull requestJul 3, 2019
…ods (francoispluchino)This PR was merged into the 4.3 branch.Discussion----------[Mime] Remove@internal annotations for the serialize methods| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes (it's not really a bug)| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | ~| License | MIT| Doc PR | ~Currently, when we extend the `Symfony\Component\Mime\Message` and `Symfony\Component\Mime\MessageRaw` classes of the Mime component, we get 2 deprecation messages:```The "Symfony\Component\Mime\Message::__serialize()" method is considered internal. It may change without further notice. You should not extend it from "Vendor\FooMessage".```and```The "Symfony\Component\Mime\Message::__unserialize()" method is considered internal. It may change without further notice. You should not extend it from "Vendor\FooMessage".```However, we need to add properties to the new class, and so, we need to extend `__serialize()` and `__unserialize()` methods in the same way as `Symfony\Bridge\Twig\Mime\TemplatedEmail`, to know, retrieve the serialization of the parent class:```php public function __serialize(): array { return [$this->foo, $this->bar, $this->baz, parent::__serialize()]; } public function __unserialize(array $data): void { [$this->foo, $this->bar, $this->baz, $parentData] = $data; parent::__unserialize($parentData); }```But given that the third-party components use another namespace, we get the 2 deprecation messages, while the 2 methods must be inevitably used and extended. Of course, the methods `serialize()` and `unserialize()` are always marked by the `@internal` annotation and the `final` keyword.This PR so deletes the 2 deprecation messages that should not be displayed.Commits-------8544a35 Remove@internal annotations for the serilize methods
ContributorAuthor
francoispluchino commentedJul 3, 2019
@fabpot@nicolas-grekas Thank you. |
Merged
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, when we extend the
Symfony\Component\Mime\MessageandSymfony\Component\Mime\MessageRawclasses of the Mime component, we get 2 deprecation messages:and
However, we need to add properties to the new class, and so, we need to extend
__serialize()and__unserialize()methods in the same way asSymfony\Bridge\Twig\Mime\TemplatedEmail, to know, retrieve the serialization of the parent class:But given that the third-party components use another namespace, we get the 2 deprecation messages, while the 2 methods must be inevitably used and extended. Of course, the methods
serialize()andunserialize()are always marked by the@internalannotation and thefinalkeyword.This PR so deletes the 2 deprecation messages that should not be displayed.