From 8ad5aec839679804a81f29252b1307869d3d6d01 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 20 Apr 2022 11:17:05 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@53232 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/install-helper.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wp-admin/install-helper.php b/src/wp-admin/install-helper.php index d46d7cc03c..733321c13e 100644 --- a/src/wp-admin/install-helper.php +++ b/src/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 ) ) {