Conversation
…CallbackUnset sniff (RFC) > . Passing non-callable strings to the xml_set_*_handler() functions is now > deprecated. > RFC: https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names While PHPCS is not particularly suitable to validate whether a string is callable or not, the _"This would also mean to unset a handler the value of null must be used instead of an empty string which is also currently allowed."_ part of the RFC should be sniffable. This commit introduces a new sniff to detect and flag this. Includes tests. Includes documentation. Refs: * https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names * https://github.com/php/php-src/blob/c42615782334323511cda18a8f0dd3dc19ed6256/UPGRADING#L496-L497 * php/php-src 15293 * php/php-src@25b4696 Related to 1731
This was referenced Aug 15, 2024
wimg
approved these changes
Sep 7, 2024
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.
While PHPCS is not particularly suitable to validate whether a string is callable or not, the "This would also mean to unset a handler the value of null must be used instead of an empty string which is also currently allowed." part of the RFC should be sniffable.
This commit introduces a new sniff to detect and flag this.
Includes tests.
Includes documentation.
Refs:
Related to #1731