Updated: Use static when calling deserializationCallback() #12
Open
karpilin wants to merge 2 commits intomatthiasnoback:masterfrom
Open
Updated: Use static when calling deserializationCallback() #12karpilin wants to merge 2 commits intomatthiasnoback:masterfrom
karpilin wants to merge 2 commits intomatthiasnoback:masterfrom
Conversation
This enables us to serialize objects that inherit from an parent using the Serializable trait. This does not work when the parent or child class have a private property that needs to be serialized, as can be seen from the provided tests.
Owner
|
Thanks for bringing this up. However, as I stated in the original PR, I wonder if you couldn't just use the trait in the child classes instead of the parent class. The result of using the trait in the parent class is predictable according to the properties of the PHP language, but will surely be a big surprise to many people. Also, there's no way to warn a user about the fact that private properties will be skipped. The warning is in the test, but not in production code, and when a user encounters this issue, they will probably spend quite some time debugging it. |
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
Sign up for free
to 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.
An old PR from @MarkRedeman has been rebased on latest master.
@matthiasnoback This is both a proof of a problem and an actual fix. I'd very much like to see this merged.