Build Tools: Upgrade WPCS to 2.0.0.

A few sniffs have been renamed, this change includes the relevant `phpcs:ignore` comment updates.

Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@44645 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-01-18 02:14:24 +00:00
parent d3ee420c14
commit 2ec6c8f3d3
4 changed files with 15 additions and 13 deletions

@ -11,7 +11,7 @@
}, },
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "~0.5.0", "dealerdirect/phpcodesniffer-composer-installer": "~0.5.0",
"wp-coding-standards/wpcs": "~1.2.0" "wp-coding-standards/wpcs": "~2.0.0"
}, },
"scripts": { "scripts": {
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source", "format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",

20
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "c3625c9fc2ce3a44cad41a64f258bafd", "content-hash": "c7426ffeca8db395605e43bccf174b02",
"packages": [], "packages": [],
"packages-dev": [ "packages-dev": [
{ {
@ -126,24 +126,26 @@
}, },
{ {
"name": "wp-coding-standards/wpcs", "name": "wp-coding-standards/wpcs",
"version": "1.2.1", "version": "2.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
"reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c" "reference": "c9eaadaafefce36b3cb7e06eb15305b8c4cae9ce"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/c9eaadaafefce36b3cb7e06eb15305b8c4cae9ce",
"reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", "reference": "c9eaadaafefce36b3cb7e06eb15305b8c4cae9ce",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3", "php": ">=5.4",
"squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" "squizlabs/php_codesniffer": "^3.3.1"
}, },
"require-dev": { "require-dev": {
"phpcompatibility/php-compatibility": "^9.0" "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
}, },
"suggest": { "suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
@ -165,7 +167,7 @@
"standards", "standards",
"wordpress" "wordpress"
], ],
"time": "2018-12-18T09:43:51+00:00" "time": "2019-01-16T10:13:16+00:00"
} }
], ],
"aliases": [], "aliases": [],

@ -7,7 +7,7 @@ class Tests_Functions extends WP_UnitTestCase {
function test_wp_parse_args_object() { function test_wp_parse_args_object() {
$x = new MockClass; $x = new MockClass;
$x->_baba = 5; $x->_baba = 5;
$x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar $x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$x->a = array( 5, 111, 'x' ); $x->a = array( 5, 111, 'x' );
$this->assertEquals( $this->assertEquals(
array( array(
@ -43,7 +43,7 @@ class Tests_Functions extends WP_UnitTestCase {
function test_wp_parse_args_defaults() { function test_wp_parse_args_defaults() {
$x = new MockClass; $x = new MockClass;
$x->_baba = 5; $x->_baba = 5;
$x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar $x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$x->a = array( 5, 111, 'x' ); $x->a = array( 5, 111, 'x' );
$d = array( 'pu' => 'bu' ); $d = array( 'pu' => 'bu' );
$this->assertEquals( $this->assertEquals(

@ -199,7 +199,7 @@ class Tests_User extends WP_UnitTestCase {
* @ticket 20043 * @ticket 20043
*/ */
public function test_user_unset() { public function test_user_unset() {
// phpcs:disable WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$user = new WP_User( self::$author_id ); $user = new WP_User( self::$author_id );
// Test custom fields // Test custom fields