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/category/categoryDescription.php

    r42368 r43571  
    88    public function test_success_query_by_id() {
    99        $description = 'Foo';
    10         $c = self::factory()->category->create( array(
    11             'description' => $description,
    12         ) );
     10        $c           = self::factory()->category->create(
     11            array(
     12                'description' => $description,
     13            )
     14        );
    1315
    14         $found = category_description( $c );
     16        $found    = category_description( $c );
    1517        $expected = apply_filters( 'term_description', $description );
    1618
     
    2022    public function test_success_query_by_object() {
    2123        $description = 'Foo';
    22         $c = self::factory()->category->create( array(
    23             'description' => $description,
    24             'slug'        => 'bar',
    25         ) );
     24        $c           = self::factory()->category->create(
     25            array(
     26                'description' => $description,
     27                'slug'        => 'bar',
     28            )
     29        );
    2630
    2731        $category = get_term( $c );
    2832
    29         $found = category_description( $c );
     33        $found    = category_description( $c );
    3034        $expected = apply_filters( 'term_description', $description );
    3135
     
    4246        $description = 'Foo';
    4347
    44         $t = self::factory()->term->create( array(
    45             'taxonomy'    => 'wptests_tax',
    46             'description' => $description,
    47         ) );
     48        $t = self::factory()->term->create(
     49            array(
     50                'taxonomy'    => 'wptests_tax',
     51                'description' => $description,
     52            )
     53        );
    4854
    4955        $term = get_term( $t );
    5056
    51         $found = category_description( $t );
     57        $found    = category_description( $t );
    5258        $expected = apply_filters( 'term_description', $description );
    5359
     
    6470        $description = 'Foo';
    6571
    66         $t = self::factory()->term->create( array(
    67             'taxonomy'    => 'wptests_tax',
    68             'description' => $description,
    69         ) );
     72        $t = self::factory()->term->create(
     73            array(
     74                'taxonomy'    => 'wptests_tax',
     75                'description' => $description,
     76            )
     77        );
    7078
    7179        clean_term_cache( $t );
    7280
    73         $found = category_description( $t );
     81        $found    = category_description( $t );
    7482        $expected = apply_filters( 'term_description', $description );
    7583
Note: See TracChangeset for help on using the changeset viewer.