mirror of
git://develop.git.wordpress.org/
synced 2025-03-15 01:19:51 +01:00
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
This commit is contained in:
parent
eb5612ddf7
commit
8ad5aec839
@ -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 ) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user