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
This commit is contained in:
Sergey Biryukov 2022-04-20 11:19:12 +00:00
parent 5fad544f8d
commit 0cc2cb34cd
2 changed files with 10 additions and 10 deletions

View File

@ -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 ) ) {

View File

@ -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.