Include class name in Serializable deprecation message#7346
Closed
jmikola wants to merge 1 commit intophp:masterfrom
Closed
Include class name in Serializable deprecation message#7346jmikola wants to merge 1 commit intophp:masterfrom
jmikola wants to merge 1 commit intophp:masterfrom
Conversation
jmikola
commented
Aug 6, 2021
| ?> | ||
| --EXPECTF-- | ||
| Deprecated: The Serializable interface is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d | ||
| Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d |
Member
Author
There was a problem hiding this comment.
The PHPT files were all changed by a single search/replace. I assume the class name is as irrelevant as the filename and line number, which also use patterns.
That said, if it makes sense to have at least one assertion for the message including the offending class name perhaps Zend/tests/serializable_deprecation.phpt is the test in which to do so. Let me know if so.
Member
|
Duplicate of #7343 :( (I'm not sure though which message format is the best) |
Member
|
I slightly preferred the phrasing here (with the class name prominently at the front), so went with this implementation. Merged with a tweak to use ZSTR_VAL. |
|
Thanks @jmikola! I also like this message more. |
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.
The deprecation message was originally introduced in 3e6b447 (#6494).
I first encountered this notice when testing the MongoDB extension with PHP 8.1, which produced many duplicate messages that provided no detail about the particular class that needed to be fixed: