From 4f861b95489387d0fd3dd1d97f7c5ddbce8e0db6 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Fri, 11 Jan 2019 06:40:50 +0000 Subject: [PATCH] Coding Standards: Fix the `Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace` violations. See #45934. Built from https://develop.svn.wordpress.org/trunk@44566 git-svn-id: http://core.svn.wordpress.org/trunk@44397 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/export.php | 6 +++--- wp-admin/includes/image.php | 5 +++-- wp-admin/update-core.php | 8 ++++---- wp-content/themes/twentyfourteen/functions.php | 4 ++-- wp-content/themes/twentythirteen/functions.php | 4 ++-- wp-includes/class-wp-locale.php | 5 +++-- wp-includes/class-wp-text-diff-renderer-table.php | 4 ++-- wp-includes/class-wp-xmlrpc-server.php | 4 ++-- wp-includes/formatting.php | 14 ++++++-------- wp-includes/general-template.php | 4 ++-- wp-includes/load.php | 6 +++--- wp-includes/media.php | 3 +-- wp-includes/version.php | 2 +- 13 files changed, 34 insertions(+), 35 deletions(-) diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 0b3dfdea8c..0b5f180923 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -203,11 +203,11 @@ function export_wp( $args = array() ) { * @return string Site URL. */ function wxr_site_url() { - // Multisite: the base URL. if ( is_multisite() ) { + // Multisite: the base URL. return network_home_url(); - } // WordPress (single site): the blog URL. - else { + } else { + // WordPress (single site): the blog URL. return get_bloginfo_rss( 'url' ); } } diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 3b435a5f22..31844b3082 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -215,8 +215,9 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { update_post_meta( $attachment_id, '_thumbnail_id', $sub_attachment_id ); } } - } // Try to create image thumbnails for PDFs - elseif ( 'application/pdf' === $mime_type ) { + } elseif ( 'application/pdf' === $mime_type ) { + // Try to create image thumbnails for PDFs. + $fallback_sizes = array( 'thumbnail', 'medium', diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 965d49199f..78e5929bf4 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -39,8 +39,8 @@ function list_core_update( $update ) { if ( 'en_US' == $update->locale && 'en_US' == get_locale() ) { $version_string = $update->current; - } // If the only available update is a partial builds, it doesn't need a language-specific version string. - elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) ) { + } elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) ) { + // If the only available update is a partial builds, it doesn't need a language-specific version string. $version_string = $update->current; } else { $version_string = sprintf( '%s–%s', $update->current, $update->locale ); @@ -121,8 +121,8 @@ function list_core_update( $update ) { echo '

'; if ( 'en_US' != $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package != $update->locale ) ) { echo '

' . __( 'This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.' ) . '

'; - } // Partial builds don't need language-specific warnings. - elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) { + } elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) { + // Partial builds don't need language-specific warnings. echo '

' . sprintf( __( 'You are about to install WordPress %s in English (US). There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ), $update->response != 'development' ? $update->current : '' ) . '

'; } echo ''; diff --git a/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index ea32f14e4f..e705a54609 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/wp-content/themes/twentyfourteen/functions.php @@ -455,8 +455,8 @@ if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : // get the URL of the next image attachment... if ( $next_id ) { $next_attachment_url = get_attachment_link( $next_id ); - } // or get the URL of the first image attachment. - else { + } else { + // or get the URL of the first image attachment. $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); } } diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 980acfc72e..dd3dec7cea 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -587,8 +587,8 @@ if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) : // get the URL of the next image attachment... if ( $next_id ) { $next_attachment_url = get_attachment_link( $next_id ); - } // or get the URL of the first image attachment. - else { + } else { + // or get the URL of the first image attachment. $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); } } diff --git a/wp-includes/class-wp-locale.php b/wp-includes/class-wp-locale.php index 287914e880..ee92bee317 100644 --- a/wp-includes/class-wp-locale.php +++ b/wp-includes/class-wp-locale.php @@ -216,8 +216,9 @@ class WP_Locale { // Set text direction. if ( isset( $GLOBALS['text_direction'] ) ) { $this->text_direction = $GLOBALS['text_direction']; - } /* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */ - elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) { + + /* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */ + } elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) { $this->text_direction = 'rtl'; } diff --git a/wp-includes/class-wp-text-diff-renderer-table.php b/wp-includes/class-wp-text-diff-renderer-table.php index 530754a930..e1912b9dda 100644 --- a/wp-includes/class-wp-text-diff-renderer-table.php +++ b/wp-includes/class-wp-text-diff-renderer-table.php @@ -389,8 +389,8 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { // Best match of this final is already taken? Must mean this final is a new row. if ( isset( $orig_matches[ $o ] ) ) { $final_matches[ $f ] = 'x'; - } // Best match of this orig is already taken? Must mean this orig is a deleted row. - elseif ( isset( $final_matches[ $f ] ) ) { + } elseif ( isset( $final_matches[ $f ] ) ) { + // Best match of this orig is already taken? Must mean this orig is a deleted row. $orig_matches[ $o ] = 'x'; } } diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index a2bf6e4a9a..923a98884f 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -2897,8 +2897,8 @@ class wp_xmlrpc_server extends IXR_Server { // If we found the page then format the data. if ( $page->ID && ( $page->post_type == 'page' ) ) { return $this->_prepare_page( $page ); - } // If the page doesn't exist indicate that. - else { + } else { + // If the page doesn't exist indicate that. return new IXR_Error( 404, __( 'Sorry, no such page.' ) ); } } diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 5a7db6d53a..83579d26ec 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2478,8 +2478,9 @@ function force_balance_tags( $text ) { if ( $stacksize <= 0 ) { $tag = ''; // or close to be safe $tag = '/' . $tag; - } // if stacktop value = tag close value then pop - elseif ( $tagstack[ $stacksize - 1 ] == $tag ) { // found closing tag + + // if stacktop value = tag close value then pop + } elseif ( $tagstack[ $stacksize - 1 ] == $tag ) { // found closing tag $tag = ''; // Close Tag // Pop array_pop( $tagstack ); @@ -2505,18 +2506,15 @@ function force_balance_tags( $text ) { // If it's an empty tag "< >", do nothing if ( '' == $tag ) { // do nothing - } // ElseIf it presents itself as a self-closing tag... - elseif ( substr( $regex[2], -1 ) == '/' ) { + } elseif ( substr( $regex[2], -1 ) == '/' ) { // ElseIf it presents itself as a self-closing tag... // ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and // immediately close it with a closing tag (the tag will encapsulate no text as a result) if ( ! in_array( $tag, $single_tags ) ) { $regex[2] = trim( substr( $regex[2], 0, -1 ) ) . "> 0 && ! in_array( $tag, $nestable_tags ) && $tagstack[ $stacksize - 1 ] == $tag ) { $tagqueue = ''; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 118d563cda..861a4c84db 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -920,8 +920,8 @@ function get_custom_logo( $blog_id = 0 ) { esc_url( home_url( '/' ) ), wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) ); - } // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview). - elseif ( is_customize_preview() ) { + } elseif ( is_customize_preview() ) { + // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview). $html = sprintf( '', esc_url( home_url( '/' ) ) diff --git a/wp-includes/load.php b/wp-includes/load.php index e404a68f9f..7fe5566e7e 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -68,11 +68,11 @@ function wp_fix_server_vars() { // Fix for IIS when running with PHP ISAPI if ( empty( $_SERVER['REQUEST_URI'] ) || ( PHP_SAPI != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { - // IIS Mod-Rewrite if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) { + // IIS Mod-Rewrite $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; - } // IIS Isapi_Rewrite - elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) { + } elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) { + // IIS Isapi_Rewrite $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; } else { // Use ORIG_PATH_INFO if there is no PATH_INFO diff --git a/wp-includes/media.php b/wp-includes/media.php index 271300958a..ace9021fd7 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -104,8 +104,7 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co if ( intval( $content_width ) > 0 && 'edit' === $context ) { $max_width = min( intval( $content_width ), $max_width ); } - } // $size == 'full' has no constraint - else { + } else { // $size == 'full' has no constraint $max_width = $width; $max_height = $height; } diff --git a/wp-includes/version.php b/wp-includes/version.php index fe066aeb97..0b2fb82ac4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-beta1-44565'; +$wp_version = '5.1-beta1-44566'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.