Skip to content

Commit

Permalink
Coding Standards: Fix instances of `Generic.WhiteSpace.ArbitraryParen…
Browse files Browse the repository at this point in the history
…thesesSpacing.FoundEmpty`.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47855 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed May 26, 2020
1 parent 6ec9c9c commit 2c75752
Show file tree
Hide file tree
Showing 28 changed files with 70 additions and 68 deletions.
4 changes: 2 additions & 2 deletions src/wp-admin/admin.php
Expand Up @@ -292,7 +292,7 @@

require_once ABSPATH . 'wp-admin/admin-footer.php';

exit();
exit;
} elseif ( isset( $_GET['import'] ) ) {

$importer = $_GET['import'];
Expand Down Expand Up @@ -353,7 +353,7 @@
// Make sure rules are flushed.
flush_rewrite_rules( false );

exit();
exit;
} else {
/**
* Fires before a particular screen is loaded.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/edit.php
Expand Up @@ -206,7 +206,7 @@
$sendback = remove_query_arg( array( 'action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback );

wp_redirect( $sendback );
exit();
exit;
} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
exit;
Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/includes/class-wp-importer.php
Expand Up @@ -134,7 +134,7 @@ public function set_blog( $blog_id ) {
$parsed = parse_url( $blog );
if ( ! $parsed || empty( $parsed['host'] ) ) {
fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" );
exit();
exit;
}
if ( empty( $parsed['path'] ) ) {
$parsed['path'] = '/';
Expand All @@ -148,7 +148,7 @@ public function set_blog( $blog_id ) {
);
if ( ! $blogs ) {
fwrite( STDERR, "Error: Could not find blog\n" );
exit();
exit;
}
$blog = array_shift( $blogs );
$blog_id = (int) $blog->blog_id;
Expand Down Expand Up @@ -176,7 +176,7 @@ public function set_user( $user_id ) {

if ( ! $user_id || ! wp_set_current_user( $user_id ) ) {
fwrite( STDERR, "Error: can not find user\n" );
exit();
exit;
}

return $user_id;
Expand Down Expand Up @@ -327,7 +327,7 @@ function get_cli_args( $param, $required = false ) {
if ( ! isset( $out[ $param ] ) && $required ) {
// Display message and exit.
echo "\"$param\" parameter is required but was not specified\n";
exit();
exit;
}

return $return;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/update-core.php
Expand Up @@ -1440,7 +1440,7 @@ function _redirect_to_about_wordpress( $new_version ) {

// Include admin-footer.php and exit.
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/load-scripts.php
Expand Up @@ -47,7 +47,7 @@

if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
header( "$protocol 304 Not Modified" );
exit();
exit;
}

foreach ( $load as $handle ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/load-styles.php
Expand Up @@ -46,7 +46,7 @@

if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
header( "$protocol 304 Not Modified" );
exit();
exit;
}

foreach ( $load as $handle ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/media.php
Expand Up @@ -53,7 +53,7 @@

if ( empty( $_GET['attachment_id'] ) ) {
wp_redirect( admin_url( 'upload.php' ) );
exit();
exit;
}
$att_id = (int) $_GET['attachment_id'];

Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/nav-menus.php
Expand Up @@ -353,7 +353,7 @@
}

wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) );
exit();
exit;
}
} else {
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
Expand Down Expand Up @@ -388,15 +388,15 @@
// If the menu ID changed, redirect to the new URL.
if ( $nav_menu_selected_id != $_nav_menu_selected_id ) {
wp_redirect( admin_url( 'nav-menus.php?menu=' . intval( $_nav_menu_selected_id ) ) );
exit();
exit;
}
}
}
break;
case 'locations':
if ( ! $num_locations ) {
wp_redirect( admin_url( 'nav-menus.php' ) );
exit();
exit;
}

add_filter( 'screen_options_show_screen', '__return_false' );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/network/edit.php
Expand Up @@ -38,4 +38,4 @@
do_action( "network_admin_edit_{$action}" );

wp_redirect( network_admin_url() );
exit();
exit;
2 changes: 1 addition & 1 deletion src/wp-admin/network/settings.php
Expand Up @@ -132,7 +132,7 @@
do_action( 'update_wpmu_options' );

wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );
exit();
exit;
}

require_once ABSPATH . 'wp-admin/admin-header.php';
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/network/site-themes.php
Expand Up @@ -160,7 +160,7 @@

if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {
wp_safe_redirect( $referer );
exit();
exit;
}

add_thickbox();
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/network/site-users.php
Expand Up @@ -188,14 +188,14 @@
}

wp_safe_redirect( add_query_arg( 'update', $update, $referer ) );
exit();
exit;
}

restore_current_blog();

if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {
wp_safe_redirect( $referer );
exit();
exit;
}

add_screen_option( 'per_page' );
Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/network/sites.php
Expand Up @@ -123,7 +123,7 @@
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
} elseif ( array_key_exists( $_GET['action'], $manage_actions ) ) {
$action = $_GET['action'];
check_admin_referer( $action . '_' . $id );
Expand Down Expand Up @@ -210,7 +210,7 @@
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
break;

case 'spam':
Expand All @@ -232,7 +232,7 @@
$redirect_to = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $blogs, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

wp_safe_redirect( $redirect_to );
exit();
exit;
}
} else {
// Process query defined by WP_MS_Site_List_Table::extra_table_nav().
Expand Down Expand Up @@ -295,7 +295,7 @@

if ( ! empty( $updated_action ) ) {
wp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) );
exit();
exit;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/wp-admin/network/users.php
Expand Up @@ -39,7 +39,7 @@
} else {
wp_redirect( network_admin_url( 'users.php' ) );
}
exit();
exit;

case 'allusers':
if ( ! current_user_can( 'manage_network_users' ) ) {
Expand All @@ -66,7 +66,7 @@
confirm_delete_users( $_POST['allusers'] );
echo '</div>';
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;

case 'spam':
$user = get_userdata( $user_id );
Expand Down Expand Up @@ -122,7 +122,7 @@
$sendback = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

wp_safe_redirect( $sendback );
exit();
exit;
}

wp_safe_redirect(
Expand All @@ -142,7 +142,7 @@
}
wp_redirect( $location );
}
exit();
exit;

case 'dodelete':
check_admin_referer( 'ms-users-delete' );
Expand Down Expand Up @@ -193,7 +193,7 @@
network_admin_url( 'users.php' )
)
);
exit();
exit;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/plugin-editor.php
Expand Up @@ -11,7 +11,7 @@

if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'plugin-editor.php' ) );
exit();
exit;
}

if ( ! current_user_can( 'edit_plugins' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/plugin-install.php
Expand Up @@ -21,7 +21,7 @@

if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'plugin-install.php' ) );
exit();
exit;
}

$wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' );
Expand Down
20 changes: 10 additions & 10 deletions src/wp-admin/post.php
Expand Up @@ -113,14 +113,14 @@
check_admin_referer( 'add-' . $post_type );
$post_id = 'postajaxpost' === $action ? edit_post() : write_post();
redirect_post( $post_id );
exit();
exit;

case 'edit':
$editing = true;

if ( empty( $post_id ) ) {
wp_redirect( admin_url( 'post.php' ) );
exit();
exit;
}

if ( ! $post ) {
Expand All @@ -147,7 +147,7 @@
check_admin_referer( 'lock-post_' . $post_id );
wp_set_post_lock( $post_id );
wp_redirect( get_edit_post_link( $post_id, 'url' ) );
exit();
exit;
}

$post_type = $post->post_type;
Expand Down Expand Up @@ -233,7 +233,7 @@

redirect_post( $post_id ); // Send user on their way while we keep working.

exit();
exit;

case 'trash':
check_admin_referer( 'trash-post_' . $post_id );
Expand Down Expand Up @@ -270,7 +270,7 @@
$sendback
)
);
exit();
exit;

case 'untrash':
check_admin_referer( 'untrash-post_' . $post_id );
Expand All @@ -292,7 +292,7 @@
}

wp_redirect( add_query_arg( 'untrashed', 1, $sendback ) );
exit();
exit;

case 'delete':
check_admin_referer( 'delete-post_' . $post_id );
Expand Down Expand Up @@ -321,15 +321,15 @@
}

wp_redirect( add_query_arg( 'deleted', 1, $sendback ) );
exit();
exit;

case 'preview':
check_admin_referer( 'update-post_' . $post_id );

$url = post_preview();

wp_redirect( $url );
exit();
exit;

case 'toggle-custom-fields':
check_admin_referer( 'toggle-custom-fields' );
Expand All @@ -341,7 +341,7 @@
}

wp_safe_redirect( wp_get_referer() );
exit();
exit;

default:
/**
Expand All @@ -356,7 +356,7 @@
do_action( "post_action_{$action}", $post_id );

wp_redirect( admin_url( 'edit.php' ) );
exit();
exit;
} // End switch.

require_once ABSPATH . 'wp-admin/admin-footer.php';
2 changes: 1 addition & 1 deletion src/wp-admin/theme-editor.php
Expand Up @@ -11,7 +11,7 @@

if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-editor.php' ) );
exit();
exit;
}

if ( ! current_user_can( 'edit_themes' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/theme-install.php
Expand Up @@ -18,7 +18,7 @@

if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-install.php' ) );
exit();
exit;
}

$title = __( 'Add Themes' );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/update-core.php
Expand Up @@ -16,7 +16,7 @@

if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'update-core.php' ) );
exit();
exit;
}

if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_languages' ) ) {
Expand Down

0 comments on commit 2c75752

Please sign in to comment.