Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (6 years ago)
Author:
pento
Message:

Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:

  • Multiline function calls must now put each parameter on a new line.
  • Auto-formatting files is now part of the grunt precommit script.
  • Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r43569 r43571  
    289289        }
    290290        echo wp_generate_tag_cloud(
    291             $tags, array(
     291            $tags,
     292            array(
    292293                'single_text'   => __( '%s plugin' ),
    293294                'multiple_text' => __( '%s plugins' ),
     
    332333 */
    333334function install_plugins_upload() {
    334 ?>
     335    ?>
    335336<div class="upload-plugin">
    336337    <p class="install-help"><?php _e( 'If you have a plugin in a .zip format, you may install it by uploading it here.' ); ?></p>
     
    342343    </form>
    343344</div>
    344 <?php
     345    <?php
    345346}
    346347
     
    502503
    503504    $api = plugins_api(
    504         'plugin_information', array(
    505             'slug'   => wp_unslash( $_REQUEST['plugin'] ),
     505        'plugin_information',
     506        array(
     507            'slug' => wp_unslash( $_REQUEST['plugin'] ),
    506508        )
    507509    );
     
    691693                )
    692694            );
    693 ?>
     695            ?>
    694696            <p aria-hidden="true" class="fyi-description"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></p>
    695         <?php
     697            <?php
    696698}
    697699
    698700if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
    699         ?>
     701    ?>
    700702            <h3><?php _e( 'Reviews' ); ?></h3>
    701703            <p class="fyi-description"><?php _e( 'Read all reviews on WordPress.org or write your own!' ); ?></p>
     
    727729}
    728730if ( ! empty( $api->contributors ) ) {
    729         ?>
     731    ?>
    730732            <h3><?php _e( 'Contributors' ); ?></h3>
    731733            <ul class="contributors">
     
    739741
    740742                    $contrib_profile = esc_url( $contrib_details['profile'] );
    741                     $contrib_avatar = esc_url( add_query_arg( 's', '36', $contrib_details['avatar'] ) );
     743                    $contrib_avatar  = esc_url( add_query_arg( 's', '36', $contrib_details['avatar'] ) );
    742744
    743745                    echo "<li><a href='{$contrib_profile}' target='_blank'><img src='{$contrib_avatar}' width='18' height='18' alt='' />{$contrib_name}</a></li>";
Note: See TracChangeset for help on using the changeset viewer.