Make WordPress Core

Changeset 53232


Ignore:
Timestamp:
04/20/2022 11:17:05 AM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/install-helper.php

    r47786 r53232  
    163163 * @global wpdb $wpdb WordPress database abstraction object.
    164164 *
    165  * @param string $table_name Database table name.
    166  * @param string $col_name   Table column name.
    167  * @param string $col_type   Table column type.
    168  * @param bool   $is_null    Optional. Check is null.
    169  * @param mixed  $key        Optional. Key info.
    170  * @param mixed  $default    Optional. Default value.
    171  * @param mixed  $extra      Optional. Extra value.
     165 * @param string $table_name    Database table name.
     166 * @param string $col_name      Table column name.
     167 * @param string $col_type      Table column type.
     168 * @param bool   $is_null       Optional. Check is null.
     169 * @param mixed  $key           Optional. Key info.
     170 * @param mixed  $default_value Optional. Default value.
     171 * @param mixed  $extra         Optional. Extra value.
    172172 * @return bool True, if matches. False, if not matching.
    173173 */
    174 function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null ) {
     174function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default_value = null, $extra = null ) {
    175175    global $wpdb;
    176176
     
    192192                ++$diffs;
    193193            }
    194             if ( ( null !== $default ) && ( $row->Default !== $default ) ) {
     194            if ( ( null !== $default_value ) && ( $row->Default !== $default_value ) ) {
    195195                ++$diffs;
    196196            }
Note: See TracChangeset for help on using the changeset viewer.