PHPC-2252: Use correct signature for Serializable::unserialize #1440
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.
PHPC-2252
The signature of
Serializable::unserialize
was changed in PHP 8: the argument was renamed from$serialized
to$data
, and a string type was added. Since users are unlikely to call this method manually AND be using named arguments on a single-parameter method, this does not have a significant downstream impact. The old signature is kept in place for PHP < 8 as adding the type would violate the original contract (which technically accepts any argument type).This also allows us to remove a workaround in the function map generation that was necessary due to the renamed parameter (see #1436 (comment) for discussion).