Skip to content

Commit 7420d57

Browse files
committed
Lint fixes
1 parent 59ca578 commit 7420d57

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/Core_Command.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,16 +1269,14 @@ public function update( $args, $assoc_args ) {
12691269

12701270
WP_CLI::success( 'WordPress updated successfully.' );
12711271
}
1272-
} else {
12731272
// Check if user attempted to downgrade without --force
1274-
if ( ! empty( Utils\get_flag_value( $assoc_args, 'version' ) ) && version_compare( Utils\get_flag_value( $assoc_args, 'version' ), $wp_version, '<' ) ) {
1275-
// Requested version is older than current (downgrade attempt)
1276-
WP_CLI::log( "WordPress is up to date at version {$wp_version}." );
1277-
WP_CLI::log( "The version you requested (" . Utils\get_flag_value( $assoc_args, 'version' ) . ") is older than the current version ({$wp_version})." );
1278-
WP_CLI::log( "Use --force to update anyway (e.g., to downgrade to version " . Utils\get_flag_value( $assoc_args, 'version' ) . ")." );
1279-
} else {
1280-
WP_CLI::success( "WordPress is up to date at version {$wp_version}." );
1281-
}
1273+
} elseif ( ! empty( Utils\get_flag_value( $assoc_args, 'version' ) ) && version_compare( Utils\get_flag_value( $assoc_args, 'version' ), $wp_version, '<' ) ) {
1274+
// Requested version is older than current (downgrade attempt)
1275+
WP_CLI::log( "WordPress is up to date at version {$wp_version}." );
1276+
WP_CLI::log( 'The version you requested (' . Utils\get_flag_value( $assoc_args, 'version' ) . ") is older than the current version ({$wp_version})." );
1277+
WP_CLI::log( 'Use --force to update anyway (e.g., to downgrade to version ' . Utils\get_flag_value( $assoc_args, 'version' ) . ').' );
1278+
} else {
1279+
WP_CLI::success( "WordPress is up to date at version {$wp_version}." );
12821280
}
12831281
}
12841282

0 commit comments

Comments
 (0)