Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (8 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/wpInsertTerm.php

    r42343 r43571  
    7979        public function test_wp_insert_term_parent_does_not_exist() {
    8080                $found = wp_insert_term(
    81                         'foo', 'post_tag', array(
     81                        'foo',
     82                        'post_tag',
     83                        array(
    8284                                'parent' => 999999,
    8385                        )
     
    101103                register_taxonomy( 'wptests_tax', 'post' );
    102104                $found = wp_insert_term(
    103                         'Quality', 'wptests_tax', array(
     105                        'Quality',
     106                        'wptests_tax',
     107                        array(
    104108                                'description' => 'Let\\\'s all say \\"Hooray\\" for WordPress taxonomy',
    105109                        )
     
    115119                register_taxonomy( 'wptests_tax', 'post' );
    116120                $found = wp_insert_term(
    117                         'Quality', 'wptests_tax', array(
     121                        'Quality',
     122                        'wptests_tax',
     123                        array(
    118124                                'parent' => 'foo1',
    119125                        )
     
    130136                register_taxonomy( 'wptests_tax', 'post' );
    131137                $found = wp_insert_term(
    132                         'Quality', 'wptests_tax', array(
     138                        'Quality',
     139                        'wptests_tax',
     140                        array(
    133141                                'slug' => '',
    134142                        )
     
    145153                register_taxonomy( 'wptests_tax', 'post' );
    146154                $found = wp_insert_term(
    147                         'Quality', 'wptests_tax', array(
     155                        'Quality',
     156                        'wptests_tax',
     157                        array(
    148158                                'slug' => '  ',
    149159                        )
     
    159169                register_taxonomy( 'wptests_tax', 'post' );
    160170                $found = wp_insert_term(
    161                         'Quality', 'wptests_tax', array(
     171                        'Quality',
     172                        'wptests_tax',
     173                        array(
    162174                                'slug' => 0,
    163175                        )
     
    260272
    261273                $t2 = wp_insert_term(
    262                         'Foo', 'wptests_tax', array(
     274                        'Foo',
     275                        'wptests_tax',
     276                        array(
    263277                                'slug' => 'foo',
    264278                        )
     
    291305
    292306                $t3 = wp_insert_term(
    293                         'Foo', 'wptests_tax', array(
     307                        'Foo',
     308                        'wptests_tax',
     309                        array(
    294310                                'slug' => 'bar',
    295311                        )
     
    314330
    315331                $t2 = wp_insert_term(
    316                         'Foo', 'wptests_tax', array(
     332                        'Foo',
     333                        'wptests_tax',
     334                        array(
    317335                                'slug' => 'foo-unique',
    318336                        )
     
    359377
    360378                $t2 = wp_insert_term(
    361                         'Foo', 'wptests_tax', array(
     379                        'Foo',
     380                        'wptests_tax',
     381                        array(
    362382                                'slug' => 'foo',
    363383                        )
     
    390410
    391411                $t3 = wp_insert_term(
    392                         'Foo', 'wptests_tax', array(
     412                        'Foo',
     413                        'wptests_tax',
     414                        array(
    393415                                'slug' => 'bar',
    394416                        )
     
    424446
    425447                $t4 = wp_insert_term(
    426                         'Foo', 'wptests_tax', array(
     448                        'Foo',
     449                        'wptests_tax',
     450                        array(
    427451                                'slug' => 'bar',
    428452                        )
     
    479503
    480504                $t1_child = wp_insert_term(
    481                         'Child', 'wptests_tax', array(
     505                        'Child',
     506                        'wptests_tax',
     507                        array(
    482508                                'parent' => $t1,
    483509                        )
     
    485511
    486512                $t2_child = wp_insert_term(
    487                         'Child', 'wptests_tax', array(
     513                        'Child',
     514                        'wptests_tax',
     515                        array(
    488516                                'parent' => $t2,
    489517                        )
     
    491519
    492520                $error = wp_insert_term(
    493                         'Child', 'wptests_tax', array(
     521                        'Child',
     522                        'wptests_tax',
     523                        array(
    494524                                'parent' => $t2,
    495525                        )
     
    515545
    516546                $t2 = wp_insert_term(
    517                         'Foo', 'wptests_tax', array(
     547                        'Foo',
     548                        'wptests_tax',
     549                        array(
    518550                                'slug' => 'foo-unique',
    519551                        )
     
    561593
    562594                $created = wp_insert_term(
    563                         'Foo 2', 'wptests_tax', array(
     595                        'Foo 2',
     596                        'wptests_tax',
     597                        array(
    564598                                'slug' => 'foo',
    565599                        )
     
    589623
    590624                $created = wp_insert_term(
    591                         'Foo 2', 'wptests_tax_2', array(
     625                        'Foo 2',
     626                        'wptests_tax_2',
     627                        array(
    592628                                'slug' => 'foo',
    593629                        )
     
    623659
    624660                $created = wp_insert_term(
    625                         'Foo 2', 'wptests_tax_2', array(
     661                        'Foo 2',
     662                        'wptests_tax_2',
     663                        array(
    626664                                'slug' => 'foo',
    627665                        )
     
    652690
    653691                $created_term_ids = wp_insert_term(
    654                         'Foo', 'wptests_tax', array(
     692                        'Foo',
     693                        'wptests_tax',
     694                        array(
    655695                                'alias_of' => $term_1->slug,
    656696                        )
     
    686726
    687727                $created_term_ids = wp_insert_term(
    688                         'Foo', 'wptests_tax', array(
     728                        'Foo',
     729                        'wptests_tax',
     730                        array(
    689731                                'alias_of' => $term_2->slug,
    690732                        )
     
    700742                register_taxonomy( 'wptests_tax', 'post' );
    701743                $created_term_ids = wp_insert_term(
    702                         'Foo', 'wptests_tax', array(
     744                        'Foo',
     745                        'wptests_tax',
     746                        array(
    703747                                'alias_of' => 'foo',
    704748                        )
     
    743787        public function test_wp_insert_term_should_clean_term_cache() {
    744788                register_taxonomy(
    745                         'wptests_tax', 'post', array(
     789                        'wptests_tax',
     790                        'post',
     791                        array(
    746792                                'hierarchical' => true,
    747793                        )
     
    764810
    765811                $found = wp_insert_term(
    766                         'foo', 'wptests_tax', array(
     812                        'foo',
     813                        'wptests_tax',
     814                        array(
    767815                                'parent' => $t,
    768816                        )
     
    837885
    838886                $term = wp_insert_term(
    839                         'foo', 'wptests_tax', array(
     887                        'foo',
     888                        'wptests_tax',
     889                        array(
    840890                                'description' => null,
    841891                        )
Note: See TracChangeset for help on using the changeset viewer.