Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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
fabpot merged 1 commit intosymfony:4.3fromfrancoispluchino:mime-remove-internal
Jul 3, 2019
Merged

[Mime] Remove @internal annotations for the serialize methods#32302

fabpot merged 1 commit intosymfony:4.3fromfrancoispluchino:mime-remove-internal
Jul 3, 2019

Conversation

@francoispluchino
Copy link
Contributor

QA
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~
LicenseMIT
Doc PR~

Currently, when we extend theSymfony\Component\Mime\Message andSymfony\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 asSymfony\Bridge\Twig\Mime\TemplatedEmail, to know, retrieve the serialization of the parent class:

publicfunction__serialize():array    {return [$this->foo,$this->bar,$this->baz,parent::__serialize()];    }publicfunction__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 methodsserialize() andunserialize() are always marked by the@internal annotation and thefinal keyword.

This PR so deletes the 2 deprecation messages that should not be displayed.

@nicolas-grekasnicolas-grekas added this to thenext milestoneJul 3, 2019
@nicolas-grekasnicolas-grekas changed the title[Mime] Remove @internal annotations for the serilize methods[Mime] Remove @internal annotations for the serialize methodsJul 3, 2019
@fabpot
Copy link
Member

Thank you@francoispluchino.

@fabpotfabpot merged commit8544a35 intosymfony:4.3Jul 3, 2019
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
@francoispluchino
Copy link
ContributorAuthor

@fabpot@nicolas-grekas Thank you.

@fabpotfabpot mentioned this pull requestJul 28, 2019
@nicolas-grekasnicolas-grekas modified the milestones:next,4.4Oct 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@francoispluchino@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp