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/media.php

    r42837 r43571  
    404404                // Add attachment metadata without sizes.
    405405                wp_update_attachment_metadata(
    406                         $id, array(
     406                        $id,
     407                        array(
    407408                                'width'  => 50,
    408409                                'height' => 50,
     
    461462                $post_id       = self::factory()->post->create();
    462463                $attachment_id = self::factory()->attachment->create_object(
    463                         $this->img_name, $post_id, array(
     464                        $this->img_name,
     465                        $post_id,
     466                        array(
    464467                                'post_mime_type' => 'image/jpeg',
    465468                                'post_type'      => 'attachment',
     
    479482                foreach ( range( 1, 3 ) as $i ) {
    480483                        $attachment_id = self::factory()->attachment->create_object(
    481                                 "image$i.jpg", 0, array(
     484                                "image$i.jpg",
     485                                0,
     486                                array(
    482487                                        'post_mime_type' => 'image/jpeg',
    483488                                        'post_type'      => 'attachment',
     
    494499                foreach ( range( 4, 6 ) as $i ) {
    495500                        $attachment_id = self::factory()->attachment->create_object(
    496                                 "image$i.jpg", 0, array(
     501                                "image$i.jpg",
     502                                0,
     503                                array(
    497504                                        'post_mime_type' => 'image/jpeg',
    498505                                        'post_type'      => 'attachment',
     
    625632                foreach ( range( 1, 3 ) as $i ) {
    626633                        $attachment_id = self::factory()->attachment->create_object(
    627                                 "image$i.jpg", 0, array(
     634                                "image$i.jpg",
     635                                0,
     636                                array(
    628637                                        'post_mime_type' => 'image/jpeg',
    629638                                        'post_type'      => 'attachment',
     
    640649                foreach ( range( 4, 6 ) as $i ) {
    641650                        $attachment_id = self::factory()->attachment->create_object(
    642                                 "image$i.jpg", 0, array(
     651                                "image$i.jpg",
     652                                0,
     653                                array(
    643654                                        'post_mime_type' => 'image/jpeg',
    644655                                        'post_type'      => 'attachment',
     
    10361047                $image_path    = '2014/11/' . $this->img_name;
    10371048                $attachment_id = self::factory()->attachment->create_object(
    1038                         $image_path, 0, array(
     1049                        $image_path,
     1050                        0,
     1051                        array(
    10391052                                'post_mime_type' => 'image/jpeg',
    10401053                                'post_type'      => 'attachment',
     
    10491062                $image_path    = '2014/11/' . $this->img_name;
    10501063                $attachment_id = self::factory()->attachment->create_object(
    1051                         $image_path, 0, array(
     1064                        $image_path,
     1065                        0,
     1066                        array(
    10521067                                'post_mime_type' => 'image/jpeg',
    10531068                                'post_type'      => 'attachment',
     
    10651080                $image_path    = '2014/11/' . $this->img_name;
    10661081                $attachment_id = self::factory()->attachment->create_object(
    1067                         $image_path, 0, array(
     1082                        $image_path,
     1083                        0,
     1084                        array(
    10681085                                'post_mime_type' => 'image/jpeg',
    10691086                                'post_type'      => 'attachment',
     
    11111128
    11121129                $post_id = media_handle_upload(
    1113                         'upload', 0, array(), array(
     1130                        'upload',
     1131                        0,
     1132                        array(),
     1133                        array(
    11141134                                'action'    => 'test_iptc_upload',
    11151135                                'test_form' => false,
     
    11471167
    11481168                $post_id = media_handle_upload(
    1149                         'upload', 0, array(), array(
     1169                        'upload',
     1170                        0,
     1171                        array(),
     1172                        array(
    11501173                                'action'    => 'test_upload_titles',
    11511174                                'test_form' => false,
     
    13131336                $post_id       = self::factory()->post->create();
    13141337                $attachment_id = self::factory()->attachment->create_object(
    1315                         $this->img_name, $post_id, array(
     1338                        $this->img_name,
     1339                        $post_id,
     1340                        array(
    13161341                                'post_mime_type' => 'image/jpeg',
    13171342                                'post_type'      => 'attachment',
     
    13341359                $post_id       = self::factory()->post->create();
    13351360                $attachment_id = self::factory()->attachment->create_object(
    1336                         $this->img_name, $post_id, array(
     1361                        $this->img_name,
     1362                        $post_id,
     1363                        array(
    13371364                                'post_mime_type' => 'image/jpeg',
    13381365                                'post_type'      => 'attachment',
     
    13521379                $post_id       = self::factory()->post->create();
    13531380                $attachment_id = self::factory()->attachment->create_object(
    1354                         $this->img_name, $post_id, array(
     1381                        $this->img_name,
     1382                        $post_id,
     1383                        array(
    13551384                                'post_mime_type' => 'image/jpeg',
    13561385                                'post_type'      => 'attachment',
     
    23772406
    23782407                $post_id = media_handle_upload(
    2379                         'upload', $parent_id, array(), array(
     2408                        'upload',
     2409                        $parent_id,
     2410                        array(),
     2411                        array(
    23802412                                'action'    => 'test_iptc_upload',
    23812413                                'test_form' => false,
     
    24262458
    24272459                $post_id = media_handle_upload(
    2428                         'upload', $parent_id, array(), array(
     2460                        'upload',
     2461                        $parent_id,
     2462                        array(),
     2463                        array(
    24292464                                'action'    => 'test_iptc_upload',
    24302465                                'test_form' => false,
Note: See TracChangeset for help on using the changeset viewer.