Code Modernization: Rename parameters that use reserved keywords in `wp-includes/functions.php`.

While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$class` parameter to `$class_name` in `_deprecated_class()`.

Follow-up to [54929], [56467].

Props jrf.
See #59161.
Built from https://develop.svn.wordpress.org/trunk@56514


git-svn-id: http://core.svn.wordpress.org/trunk@56026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-09-05 12:25:13 +00:00
parent ed6e84c280
commit 70d853b9cd
2 changed files with 9 additions and 9 deletions

View File

@ -5625,23 +5625,23 @@ function _deprecated_constructor( $class_name, $version, $parent_class = '' ) {
*
* @since 6.4.0
*
* @param string $class The class being instantiated.
* @param string $class_name The name of the class being instantiated.
* @param string $version The version of WordPress that deprecated the class.
* @param string $replacement Optional. The class or function that should have been called.
* Default empty string.
*/
function _deprecated_class( $class, $version, $replacement = '' ) {
function _deprecated_class( $class_name, $version, $replacement = '' ) {
/**
* Fires when a deprecated class is called.
*
* @since 6.4.0
*
* @param string $class The class being instantiated.
* @param string $class_name The name of the class being instantiated.
* @param string $replacement The class or function that should have been called.
* @param string $version The version of WordPress that deprecated the class.
*/
do_action( 'deprecated_class_run', $class, $replacement, $version );
do_action( 'deprecated_class_run', $class_name, $replacement, $version );
/**
* Filters whether to trigger an error for a deprecated class.
@ -5657,7 +5657,7 @@ function _deprecated_class( $class, $version, $replacement = '' ) {
sprintf(
/* translators: 1: PHP class name, 2: Version number, 3: Alternative class or function name. */
__( 'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
$class,
$class_name,
$version,
$replacement
),
@ -5668,7 +5668,7 @@ function _deprecated_class( $class, $version, $replacement = '' ) {
sprintf(
/* translators: 1: PHP class name, 2: Version number. */
__( 'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
$class,
$class_name,
$version
),
E_USER_DEPRECATED
@ -5679,7 +5679,7 @@ function _deprecated_class( $class, $version, $replacement = '' ) {
trigger_error(
sprintf(
'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
$class,
$class_name,
$version,
$replacement
),
@ -5689,7 +5689,7 @@ function _deprecated_class( $class, $version, $replacement = '' ) {
trigger_error(
sprintf(
'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
$class,
$class_name,
$version
),
E_USER_DEPRECATED

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-alpha-56513';
$wp_version = '6.4-alpha-56514';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.