@@ -1128,23 +1128,23 @@ private function make_sqlite_field_definition( $field ) {
1128
1128
* This mode allows the use of `NULL` when NOT NULL is set on a column that falls back to DEFAULT.
1129
1129
* SQLite does not support this behavior, so we need to add the `ON CONFLICT REPLACE` clause to the column definition.
1130
1130
*/
1131
- if ($ field ->not_null ) {
1131
+ if ( $ field ->not_null ) {
1132
1132
$ definition .= ' ON CONFLICT REPLACE ' ;
1133
1133
}
1134
1134
/**
1135
1135
* The value of DEFAULT can be NULL. PHP would print this as an empty string, so we need a special case for it.
1136
1136
*/
1137
- if (null === $ field ->default ) {
1137
+ if ( null === $ field ->default ) {
1138
1138
$ definition .= ' DEFAULT NULL ' ;
1139
- } else if ( false !== $ field ->default ) {
1139
+ } elseif ( false !== $ field ->default ) {
1140
1140
$ definition .= ' DEFAULT ' . $ field ->default ;
1141
- } else if ( $ field ->not_null ) {
1141
+ } elseif ( $ field ->not_null ) {
1142
1142
/**
1143
1143
* If the column is NOT NULL, we need to provide a default value to match WPDB behavior caused by removing the STRICT_TRANS_TABLES mode.
1144
1144
*/
1145
- if ('text ' === $ field ->sqlite_data_type ) {
1145
+ if ( 'text ' === $ field ->sqlite_data_type ) {
1146
1146
$ definition .= ' DEFAULT \'\'' ;
1147
- } else if ( in_array ($ field ->sqlite_data_type , array ('integer ' , 'real ' ), true ) ) {
1147
+ } elseif ( in_array ( $ field ->sqlite_data_type , array ( 'integer ' , 'real ' ), true ) ) {
1148
1148
$ definition .= ' DEFAULT 0 ' ;
1149
1149
}
1150
1150
}
@@ -3377,19 +3377,19 @@ private function execute_show() {
3377
3377
case 'TABLE STATUS ' : // FROM `database`.
3378
3378
// Match the optional [{FROM | IN} db_name]
3379
3379
$ database_expression = $ this ->rewriter ->consume ();
3380
- if ( $ database_expression ->token === ' FROM ' || $ database_expression ->token === ' IN ' ) {
3380
+ if ( ' FROM ' === $ database_expression ->token || ' IN ' === $ database_expression ->token ) {
3381
3381
$ this ->rewriter ->consume ();
3382
3382
$ database_expression = $ this ->rewriter ->consume ();
3383
3383
}
3384
3384
3385
3385
$ pattern = '% ' ;
3386
3386
// [LIKE 'pattern' | WHERE expr]
3387
- if ( $ database_expression ->token === ' LIKE ' ) {
3387
+ if ( ' LIKE ' === $ database_expression ->token ) {
3388
3388
$ pattern = $ this ->rewriter ->consume ()->value ;
3389
- } else if ( $ database_expression ->token === ' WHERE ' ) {
3389
+ } elseif ( ' WHERE ' === $ database_expression ->token ) {
3390
3390
// @TODO Support me please.
3391
- } else if ( $ database_expression ->token !== ' ; ' ) {
3392
- throw new Exception ( 'Syntax error: Unexpected token ' . $ database_expression ->token .' in query ' . $ this ->mysql_query );
3391
+ } elseif ( ' ; ' !== $ database_expression ->token ) {
3392
+ throw new Exception ( 'Syntax error: Unexpected token ' . $ database_expression ->token . ' in query ' . $ this ->mysql_query );
3393
3393
}
3394
3394
3395
3395
$ database_expression = $ this ->rewriter ->skip ();
@@ -3418,12 +3418,11 @@ private function execute_show() {
3418
3418
type='table'
3419
3419
AND name LIKE :pattern
3420
3420
ORDER BY name " ,
3421
-
3422
3421
array (
3423
3422
':pattern ' => $ pattern ,
3424
3423
)
3425
3424
);
3426
- $ tables = $ this ->strip_sqlite_system_tables ( $ stmt ->fetchAll ( $ this ->pdo_fetch_mode ) );
3425
+ $ tables = $ this ->strip_sqlite_system_tables ( $ stmt ->fetchAll ( $ this ->pdo_fetch_mode ) );
3427
3426
foreach ( $ tables as $ table ) {
3428
3427
$ table_name = $ table ->Name ; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
3429
3428
$ stmt = $ this ->execute_sqlite_query ( "SELECT COUNT(1) as `Rows` FROM $ table_name " );
0 commit comments