From 0cc2cb34cd0633939e41658028f7d2dfa73b4744 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 20 Apr 2022 11:19:12 +0000 Subject: [PATCH] Code Modernization: Rename parameters that use reserved keywords in `wp-admin/install-helper.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 `$default` parameter to `$default_value` in `check_column()`. Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #55327. Built from https://develop.svn.wordpress.org/trunk@53232 git-svn-id: http://core.svn.wordpress.org/trunk@52821 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/install-helper.php | 18 +++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-admin/install-helper.php b/wp-admin/install-helper.php index d46d7cc03c..733321c13e 100644 --- a/wp-admin/install-helper.php +++ b/wp-admin/install-helper.php @@ -162,16 +162,16 @@ function maybe_drop_column( $table_name, $column_name, $drop_ddl ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $table_name Database table name. - * @param string $col_name Table column name. - * @param string $col_type Table column type. - * @param bool $is_null Optional. Check is null. - * @param mixed $key Optional. Key info. - * @param mixed $default Optional. Default value. - * @param mixed $extra Optional. Extra value. + * @param string $table_name Database table name. + * @param string $col_name Table column name. + * @param string $col_type Table column type. + * @param bool $is_null Optional. Check is null. + * @param mixed $key Optional. Key info. + * @param mixed $default_value Optional. Default value. + * @param mixed $extra Optional. Extra value. * @return bool True, if matches. False, if not matching. */ -function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null ) { +function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default_value = null, $extra = null ) { global $wpdb; $diffs = 0; @@ -191,7 +191,7 @@ function check_column( $table_name, $col_name, $col_type, $is_null = null, $key if ( ( null !== $key ) && ( $row->Key !== $key ) ) { ++$diffs; } - if ( ( null !== $default ) && ( $row->Default !== $default ) ) { + if ( ( null !== $default_value ) && ( $row->Default !== $default_value ) ) { ++$diffs; } if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 61b784be23..8c793f0caf 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-beta2-53231'; +$wp_version = '6.0-beta2-53232'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.