WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (3 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/tests/phpunit/tests/customize/partial.php

    r42343 r43571  
    117117
    118118        $partial = new WP_Customize_Partial(
    119             $this->selective_refresh, $partial_id, array(
     119            $this->selective_refresh,
     120            $partial_id,
     121            array(
    120122                'settings' => 'blogdescription',
    121123            )
     
    222224    function test_render_with_bad_callback_should_give_preference_to_return_value() {
    223225        $partial = new WP_Customize_Partial(
    224             $this->selective_refresh, 'foo', array(
     226            $this->selective_refresh,
     227            'foo',
     228            array(
    225229                'render_callback' => array( $this, 'render_echo_and_return' ),
    226230            )
     
    237241    function test_render_echo_callback() {
    238242        $partial                                       = new WP_Customize_Partial(
    239             $this->selective_refresh, 'foo', array(
     243            $this->selective_refresh,
     244            'foo',
     245            array(
    240246                'render_callback' => array( $this, 'render_echo' ),
    241247            )
     
    258264    function test_render_return_callback() {
    259265        $partial                                       = new WP_Customize_Partial(
    260             $this->selective_refresh, 'foo', array(
     266            $this->selective_refresh,
     267            'foo',
     268            array(
    261269                'render_callback' => array( $this, 'render_return' ),
    262270            )
     
    320328        do_action( 'customize_register', $this->wp_customize );
    321329        $partial = new WP_Customize_Partial(
    322             $this->selective_refresh, 'blogname', array(
     330            $this->selective_refresh,
     331            'blogname',
     332            array(
    323333                'settings' => array( 'blogname' ),
    324334            )
     
    327337
    328338        $partial = new WP_Customize_Partial(
    329             $this->selective_refresh, 'blogname', array(
     339            $this->selective_refresh,
     340            'blogname',
     341            array(
    330342                'settings' => array( 'blogname', 'non_existing' ),
    331343            )
     
    334346
    335347        $this->wp_customize->add_setting(
    336             'top_secret_message', array(
     348            'top_secret_message',
     349            array(
    337350                'capability' => 'top_secret_clearance',
    338351            )
    339352        );
    340353        $partial = new WP_Customize_Partial(
    341             $this->selective_refresh, 'blogname', array(
     354            $this->selective_refresh,
     355            'blogname',
     356            array(
    342357                'settings' => array( 'blogname', 'top_secret_clearance' ),
    343358            )
     
    346361
    347362        $partial = new WP_Customize_Partial(
    348             $this->selective_refresh, 'no_setting', array(
     363            $this->selective_refresh,
     364            'no_setting',
     365            array(
    349366                'settings' => array(),
    350367            )
     
    353370
    354371        $partial = new WP_Customize_Partial(
    355             $this->selective_refresh, 'no_setting', array(
     372            $this->selective_refresh,
     373            'no_setting',
     374            array(
    356375                'settings'   => array(),
    357376                'capability' => 'top_secret_clearance',
     
    361380
    362381        $partial = new WP_Customize_Partial(
    363             $this->selective_refresh, 'no_setting', array(
     382            $this->selective_refresh,
     383            'no_setting',
     384            array(
    364385                'settings'   => array(),
    365386                'capability' => 'edit_theme_options',
Note: See TracChangeset for help on using the changeset viewer.