Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jrfnl/fb680994d2d6f99c36e68a710fc2740d to your computer and use it in GitHub Desktop.

Select an option

Save jrfnl/fb680994d2d6f99c36e68a710fc2740d to your computer and use it in GitHub Desktop.
Impact analysis proposed PHP 8.6 deprecation of readonly as function name on Packagist top 4000
<?xml version="1.0"?>
<ruleset name="Impact check for https://wiki.php.net/rfc/deprecations_php_8_6">
<!-- This ruleset should only be used in conjunction with PHPCompatibility at commit
https://github.com/PHPCompatibility/PHPCompatibility/commit/cc67a3824dda9612896f5892c2d6d9408fa20d77 -->
<file>sources</file>
<arg name="extensions" value="php"/>
<arg value="ps"/>
<arg name="basepath" value="./sources/"/>
<arg name="parallel" value="8"/>
<arg name="no-colors"/>
<arg name="ignore-annotations"/>
<arg name="report" value="code,summary,source"/>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<!-- We are specifically and only checking for the PHP 8.6 deprecation(s). -->
<config name="testVersion" value="8.6"/>
<rule ref="PHPCompatibility.Keywords.ForbiddenNames.readonlyFound"/>
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<rule ref="Internal.LineEndings.Mixed">
<severity>0</severity>
</rule>
</ruleset>
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
----------------------------------------------------------------------
SOURCE COUNT
----------------------------------------------------------------------
PHPCompatibility.Keywords.ForbiddenNames.readonlyFound 2
----------------------------------------------------------------------
A TOTAL OF 2 SNIFF VIOLATIONS WERE FOUND IN 1 SOURCE
----------------------------------------------------------------------
PHP CODE SNIFFER REPORT SUMMARY
-----------------------------------------------------------------------------------------
FILE ERRORS WARNINGS
-----------------------------------------------------------------------------------------
johnpbloch\wordpress-core--7.0.0\wp-includes\php-compat\readonly.php 1 0
roots\wordpress-no-content--7.0\wp-includes\php-compat\readonly.php 1 0
-----------------------------------------------------------------------------------------
A TOTAL OF 2 ERRORS AND 0 WARNINGS WERE FOUND IN 2 FILES
-----------------------------------------------------------------------------------------
FILE: johnpbloch\wordpress-core--7.0.0\wp-includes\php-compat\readonly.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 34: ERROR Function name, class name, namespace name or constant name can not be reserved keyword 'readonly' (since version 8.1)
(PHPCompatibility.Keywords.ForbiddenNames.readonlyFound)
------------------------------------------------------------------------------------------------------------------------------------------------------
32: * @return string HTML attribute or empty string.
33: */
>> 34: function readonly( $readonly_value, $current = true, $display = true ) {
35: _deprecated_function( __FUNCTION__, '5.9.0', 'wp_readonly()' );
36: return wp_readonly( $readonly_value, $current, $display );
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: roots\wordpress-no-content--7.0\wp-includes\php-compat\readonly.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 34: ERROR Function name, class name, namespace name or constant name can not be reserved keyword 'readonly' (since version 8.1)
(PHPCompatibility.Keywords.ForbiddenNames.readonlyFound)
------------------------------------------------------------------------------------------------------------------------------------------------------
32: * @return string HTML attribute or empty string.
33: */
>> 34: function readonly( $readonly_value, $current = true, $display = true ) {
35: _deprecated_function( __FUNCTION__, '5.9.0', 'wp_readonly()' );
36: return wp_readonly( $readonly_value, $current, $display );
------------------------------------------------------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment