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/src/wp-includes/widgets/class-wp-widget-archives.php

    r42343 r43571  
    7373                         */
    7474                        $dropdown_args = apply_filters(
    75                                 'widget_archives_dropdown_args', array(
     75                                'widget_archives_dropdown_args',
     76                                array(
    7677                                        'type'            => 'monthly',
    7778                                        'format'          => 'option',
    7879                                        'show_post_count' => $c,
    79                                 ), $instance
     80                                ),
     81                                $instance
    8082                        );
    8183
     
    105107                <?php } else { ?>
    106108                <ul>
    107                 <?php
    108                 /**
    109                  * Filters the arguments for the Archives widget.
    110                  *
    111                  * @since 2.8.0
    112                  * @since 4.9.0 Added the `$instance` parameter.
    113                  *
    114                  * @see wp_get_archives()
    115                  *
    116                  * @param array $args     An array of Archives option arguments.
    117                  * @param array $instance Array of settings for the current widget.
    118                  */
    119                 wp_get_archives(
    120                         apply_filters(
    121                                 'widget_archives_args', array(
    122                                         'type'            => 'monthly',
    123                                         'show_post_count' => $c,
    124                                 ), $instance
    125                         )
    126                 );
    127                 ?>
     109                        <?php
     110                        /**
     111                         * Filters the arguments for the Archives widget.
     112                         *
     113                         * @since 2.8.0
     114                         * @since 4.9.0 Added the `$instance` parameter.
     115                         *
     116                         * @see wp_get_archives()
     117                         *
     118                         * @param array $args     An array of Archives option arguments.
     119                         * @param array $instance Array of settings for the current widget.
     120                         */
     121                        wp_get_archives(
     122                                apply_filters(
     123                                        'widget_archives_args',
     124                                        array(
     125                                                'type'            => 'monthly',
     126                                                'show_post_count' => $c,
     127                                        ),
     128                                        $instance
     129                                )
     130                        );
     131                        ?>
    128132                </ul>
    129                 <?php
     133                        <?php
    130134}
    131135
     
    146150                $instance             = $old_instance;
    147151                $new_instance         = wp_parse_args(
    148                         (array) $new_instance, array(
     152                        (array) $new_instance,
     153                        array(
    149154                                'title'    => '',
    150155                                'count'    => 0,
     
    168173        public function form( $instance ) {
    169174                $instance = wp_parse_args(
    170                         (array) $instance, array(
     175                        (array) $instance,
     176                        array(
    171177                                'title'    => '',
    172178                                'count'    => 0,
Note: See TracChangeset for help on using the changeset viewer.