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/customize/setting.php

    r42799 r43571  
    445445        $setting_id = 'custom_without_previewing_value_filter';
    446446        $setting    = $this->manager->add_setting(
    447             $setting_id, array(
     447            $setting_id,
     448            array(
    448449                'type'              => 'custom_preview_test',
    449450                'default'           => 123,
     
    600601        $name    = 'autoloaded1';
    601602        $setting = new WP_Customize_Setting(
    602             $this->manager, $name, array(
     603            $this->manager,
     604            $name,
     605            array(
    603606                'type' => 'option',
    604607            )
     
    613616        $name    = 'autoloaded2';
    614617        $setting = new WP_Customize_Setting(
    615             $this->manager, $name, array(
     618            $this->manager,
     619            $name,
     620            array(
    616621                'type'     => 'option',
    617622                'autoload' => true,
     
    627632        $name    = 'not-autoloaded1';
    628633        $setting = new WP_Customize_Setting(
    629             $this->manager, $name, array(
     634            $this->manager,
     635            $name,
     636            array(
    630637                'type'     => 'option',
    631638                'autoload' => false,
     
    641648        $id_base  = 'multi-not-autoloaded';
    642649        $setting1 = new WP_Customize_Setting(
    643             $this->manager, $id_base . '[foo]', array(
     650            $this->manager,
     651            $id_base . '[foo]',
     652            array(
    644653                'type' => 'option',
    645654            )
    646655        );
    647656        $setting2 = new WP_Customize_Setting(
    648             $this->manager, $id_base . '[bar]', array(
     657            $this->manager,
     658            $id_base . '[bar]',
     659            array(
    649660                'type'     => 'option',
    650661                'autoload' => false,
     
    696707    public function test_validate() {
    697708        $setting  = new WP_Customize_Setting(
    698             $this->manager, 'name', array(
     709            $this->manager,
     710            'name',
     711            array(
    699712                'type'              => 'key',
    700713                'validate_callback' => array( $this, 'filter_validate_for_test_validate' ),
     
    736749        $initial_value = 456;
    737750        set_theme_mod(
    738             'nav_menu_locations', array(
     751            'nav_menu_locations',
     752            array(
    739753                'primary' => $initial_value,
    740754            )
Note: See TracChangeset for help on using the changeset viewer.