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/tests/phpunit/tests/term/splitSharedTerm.php

    r42343 r43571  
    2727        register_taxonomy( 'wptests_tax', 'post' );
    2828        register_taxonomy(
    29             'wptests_tax_2', 'post', array(
     29            'wptests_tax_2',
     30            'post',
     31            array(
    3032                'hierarchical' => true,
    3133            )
     
    5557
    5658        $t2_child = wp_insert_term(
    57             'Foo Child', 'wptests_tax_2', array(
     59            'Foo Child',
     60            'wptests_tax_2',
     61            array(
    5862                'parent' => $t1['term_id'],
    5963            )
     
    9094    public function test_should_retain_child_terms_when_using_get_terms_parent() {
    9195        $children = get_terms(
    92             'wptests_tax_2', array(
     96            'wptests_tax_2',
     97            array(
    9398                'parent'     => $this->terms['t2']['term_id'],
    9499                'hide_empty' => false,
     
    104109    public function test_should_retain_child_terms_when_using_get_terms_child_of() {
    105110        $children = get_terms(
    106             'wptests_tax_2', array(
     111            'wptests_tax_2',
     112            array(
    107113                'child_of'   => $this->terms['t2']['term_id'],
    108114                'hide_empty' => false,
     
    121127        register_taxonomy( 'wptests_tax_3', 'post' );
    122128        register_taxonomy(
    123             'wptests_tax_4', 'post', array(
     129            'wptests_tax_4',
     130            'post',
     131            array(
    124132                'hierarchical' => true,
    125133            )
     
    129137        $t2 = wp_insert_term( 'Foo1 Parent', 'wptests_tax_4' );
    130138        $t3 = wp_insert_term(
    131             'Foo1', 'wptests_tax_4', array(
     139            'Foo1',
     140            'wptests_tax_4',
     141            array(
    132142                'parent' => $t2['term_id'],
    133143            )
     
    201211        $menu_id       = wp_create_nav_menu( rand_str() );
    202212        $cat_menu_item = wp_update_nav_menu_item(
    203             $menu_id, 0, array(
     213            $menu_id,
     214            0,
     215            array(
    204216                'menu-item-type'      => 'taxonomy',
    205217                'menu-item-object'    => 'category',
     
    266278        $t1            = wp_insert_term( 'Random term', 'category' );
    267279        $cat_menu_item = wp_update_nav_menu_item(
    268             $shared_term_id, 0, array(
     280            $shared_term_id,
     281            0,
     282            array(
    269283                'menu-item-type'      => 'taxonomy',
    270284                'menu-item-object'    => 'category',
     
    276290        // Updating the menu will split the shared term.
    277291        $new_nav_menu_id = wp_update_nav_menu_object(
    278             $shared_term_id, array(
     292            $shared_term_id,
     293            array(
    279294                'description' => 'Updated Foo Menu',
    280295                'menu-name'   => 'Updated Foo Menu',
Note: See TracChangeset for help on using the changeset viewer.