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/post/thumbnails.php

    r42382 r43571  
    1919        $file                = DIR_TESTDATA . '/images/canola.jpg';
    2020        self::$attachment_id = $factory->attachment->create_upload_object(
    21             $file, self::$post->ID, array(
     21            $file,
     22            self::$post->ID,
     23            array(
    2224                'post_mime_type' => 'image/jpeg',
    2325            )
     
    9597        $post_id       = self::factory()->post->create();
    9698        $attachment_id = self::factory()->attachment->create_object(
    97             'image.jpg', $post_id, array(
     99            'image.jpg',
     100            $post_id,
     101            array(
    98102                'post_mime_type' => 'image/jpeg',
    99103                'post_type'      => 'attachment',
     
    113117        $post_id       = self::factory()->post->create();
    114118        $attachment_id = self::factory()->attachment->create_object(
    115             'image.jpg', $post_id, array(
     119            'image.jpg',
     120            $post_id,
     121            array(
    116122                'post_mime_type' => 'image/jpeg',
    117123                'post_type'      => 'attachment',
     
    133139        $post_id       = self::factory()->post->create();
    134140        $attachment_id = self::factory()->attachment->create_object(
    135             'image.jpg', $post_id, array(
     141            'image.jpg',
     142            $post_id,
     143            array(
    136144                'post_mime_type' => 'image/jpeg',
    137145                'post_type'      => 'attachment',
     
    152160
    153161        $expected = wp_get_attachment_image(
    154             self::$attachment_id, 'post-thumbnail', false, array(
     162            self::$attachment_id,
     163            'post-thumbnail',
     164            false,
     165            array(
    155166                'class' => 'attachment-post-thumbnail size-post-thumbnail wp-post-image',
    156167            )
     
    177188
    178189        $expected = wp_get_attachment_image(
    179             self::$attachment_id, 'post-thumbnail', false, array(
     190            self::$attachment_id,
     191            'post-thumbnail',
     192            false,
     193            array(
    180194                'class' => 'attachment-post-thumbnail size-post-thumbnail wp-post-image',
    181195            )
Note: See TracChangeset for help on using the changeset viewer.