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/meta/registerMeta.php

    r43378 r43571  
    6969                'auth'     => 10,
    7070                'sanitize' => 10,
    71             ), $has_filters
     71            ),
     72            $has_filters
    7273        );
    7374    }
     
    431432
    432433        // This will override the above registration for objects of $subtype.
    433         register_meta( $type, 'registered_key1', array(
    434             'object_subtype' => $subtype,
    435             'single'         => true,
    436         ) );
     434        register_meta(
     435            $type,
     436            'registered_key1',
     437            array(
     438                'object_subtype' => $subtype,
     439                'single'         => true,
     440            )
     441        );
    437442
    438443        // For testing with $single => false.
    439         register_meta( $type, 'registered_key2', array(
    440             'object_subtype' => $subtype,
    441         ) );
     444        register_meta(
     445            $type,
     446            'registered_key2',
     447            array(
     448                'object_subtype' => $subtype,
     449            )
     450        );
    442451
    443452        // Register another meta key for a different subtype.
    444         register_meta( $type, 'registered_key3', array(
    445             'object_subtype' => 'other_subtype',
    446         ) );
     453        register_meta(
     454            $type,
     455            'registered_key3',
     456            array(
     457                'object_subtype' => 'other_subtype',
     458            )
     459        );
    447460
    448461        $object_property_name = $type . '_id';
    449         $object_id = self::$$object_property_name;
     462        $object_id            = self::$$object_property_name;
    450463
    451464        add_metadata( $type, $object_id, 'registered_key1', 'value1' );
     
    474487    public function test_get_object_subtype( $type, $expected_subtype ) {
    475488        $object_property_name = $type . '_id';
    476         $object_id = self::$$object_property_name;
     489        $object_id            = self::$$object_property_name;
    477490
    478491        $this->assertSame( $expected_subtype, get_object_subtype( $type, $object_id ) );
Note: See TracChangeset for help on using the changeset viewer.