Skip to content

PHP 8.4 | ✨ New PHPCompatibility.ParameterValues.RemovedXmlSetHandlerCallbackUnset sniff (RFC)#1744

Merged
wimg merged 1 commit intodevelopfrom
php-8.4/new-removedxmlsethandledcallbackunset-sniff
Sep 7, 2024
Merged

PHP 8.4 | ✨ New PHPCompatibility.ParameterValues.RemovedXmlSetHandlerCallbackUnset sniff (RFC)#1744
wimg merged 1 commit intodevelopfrom
php-8.4/new-removedxmlsethandledcallbackunset-sniff

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 15, 2024

. 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:

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
@wimg wimg merged commit 0c8cfbd into develop Sep 7, 2024
@wimg wimg deleted the php-8.4/new-removedxmlsethandledcallbackunset-sniff branch September 7, 2024 19:02
@jrfnl jrfnl added the PHP: 8.4 label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants