From 70d853b9cd1035609cf67a05cc610cd90206d2bd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 5 Sep 2023 12:25:13 +0000 Subject: [PATCH] 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 --- wp-includes/functions.php | 16 ++++++++-------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e0c859cc8f..db4fbf2a3b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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 deprecated 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 deprecated 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 deprecated 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 deprecated since version %2$s with no alternative available.', - $class, + $class_name, $version ), E_USER_DEPRECATED diff --git a/wp-includes/version.php b/wp-includes/version.php index 2b82e40391..88bd04a910 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.