Skip to content

Commit 28ef391

Browse files
committed
Lint fix
1 parent aabd7e0 commit 28ef391

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/DB_Command_SQLite.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ protected function sqlite_export( $file, $assoc_args ) {
336336
foreach ( $exclude_tables as $table ) {
337337
// Escape double quotes within the table name and wrap it in double quotes.
338338
$escaped_identifier = '"' . str_replace( '"', '""', $table ) . '"';
339-
$drop_statements[] = sprintf( 'DROP TABLE %s;', $escaped_identifier );
339+
$drop_statements[] = sprintf( 'DROP TABLE %s;', $escaped_identifier );
340340
}
341341

342342
if ( ! empty( $drop_statements ) ) {
@@ -370,17 +370,15 @@ protected function sqlite_export( $file, $assoc_args ) {
370370
if ( $stdout ) {
371371
readfile( $export_db );
372372
unlink( $export_db );
373-
} else {
374-
if ( ! @rename( $export_db, $file ) ) {
373+
} elseif ( ! @rename( $export_db, $file ) ) {
375374
// Clean up temporary files and surface a clear error if the export cannot be moved.
376-
if ( file_exists( $export_db ) ) {
377-
unlink( $export_db );
378-
}
379-
if ( file_exists( $temp_db ) ) {
380-
unlink( $temp_db );
381-
}
382-
WP_CLI::error( "Could not move exported database to '{$file}'. Please check that the path is writable and on the same filesystem." );
375+
if ( file_exists( $export_db ) ) {
376+
unlink( $export_db );
377+
}
378+
if ( file_exists( $temp_db ) ) {
379+
unlink( $temp_db );
383380
}
381+
WP_CLI::error( "Could not move exported database to '{$file}'. Please check that the path is writable and on the same filesystem." );
384382
}
385383
unlink( $temp_db );
386384

0 commit comments

Comments
 (0)