-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Drop \Serializable implementations #30051
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
This is a work in progress. There are some issues to be solved. KernelInterface APII'm not able to mesure the impact of droping TestsTraces into objectsThis new serialization strategy injects a trace into the serialized objects.
Tests realying on serialized strings
Tests failing
|
src/Symfony/Component/Config/Resource/ClassExistenceResource.php
Outdated
Show resolved
Hide resolved
I would consider implementing |
src/Symfony/Component/Config/Resource/ClassExistenceResource.php
Outdated
Show resolved
Hide resolved
@stof, using __sleep without transient attribute will break serialization for child classes (if parent class has private attributes in the bulk). In other words: Serializing extended classes won't work anymore. Real example: I ketp the trasient attribute in the Here is a list of classes that mention private attributes in
Please, check if I should revert it for some of them. Here is the list of classes mentioning only protected attributes in
Here is the list of classes I did changed the transient attribute approach:
@nicolas-grekas Tests still failing:
|
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.
LGTM, with a minor comment.
Let's make tests pass and good to go.
We could and should IMHO make all these classes final, in another PR if you're up to.
src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php
Outdated
Show resolved
Hide resolved
Actually, we cannot do that for Maybe split the data-collector related changes to a separate PR to move the rest forward? |
I think we can drop |
And we still need to move forward, so we need plans :) |
Updates:
❗ Test failing It seems the strategy applyed in Here is an example where native |
OK for dropping |
Changelogs updated. Not sure about upgrade files, so I didn't update them. |
Thank you @renanbr. |
This PR was merged into the 4.3-dev branch. Discussion ---------- Drop \Serializable implementations | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes, it removes `\Serializable` interface from many classes | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This PR replaces [Serializable](https://secure.php.net/serializable) implementations with [__sleep() and __wakeup()](http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep). Changes touch these components: - Config - DependencyInjection - Form - HttpKernel - Validator Commits ------- f8bf973 Drop \Serializable
\Serializable
interface from many classesThis PR replaces Serializable implementations with __sleep() and __wakeup().
Changes touch these components: