PHP 8.4 | :sparkles: New PHPCompatibility.ParameterValues.RemovedXmlSetHandlerCallbackUnset sniff (RFC) by jrfnl · Pull Request #1744 · PHPCompatibility/PHPCompatibility
Navigation Menu
{{ message }}
PHPCompatibility / PHPCompatibility Public
- Notifications You must be signed in to change notification settings
- Fork 204
Merged
Sep 7, 2024Conversation
Copy link Copy Markdown
Member
jrfnl
commented
Aug 15, 2024
jrfnl
commented
. 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
- ext/xml: Deprecate xml_set_object() and passing non-callable strings to handlers php/php-src#15293
- php/php-src@25b4696
Related to #1731
…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
jrfnl
added
Type: enhancement
PR: ready for review
labels
jrfnl
added this to the
10.0.0 milestone
jrfnl
requested a review
from wimg
This was referenced
Aug 15, 2024wimg approved these changes Sep 7, 2024
wimg
merged commit
0c8cfbd
into
develop
wimg
deleted the
php-8.4/new-removedxmlsethandledcallbackunset-sniff
branch
github-actions
bot
removed
the
PR: ready for review
label
jrfnl
added
the
PHP: 8.4
label
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