Integrated PHPCompatibility with PHPCS

- Updated phpcs.ruleset.xml to exclude patterns and set installed_paths.
- Updated woocommerce/woocommerce-git-hooks to version 1.0.3
This commit is contained in:
Claudio Sanches 2017-11-09 16:32:04 -02:00
parent 6e08ff0284
commit 3062dba4e5
3 changed files with 104 additions and 36 deletions

View File

@ -11,7 +11,8 @@
"squizlabs/php_codesniffer": "*", "squizlabs/php_codesniffer": "*",
"wp-coding-standards/wpcs": "0.13.1", "wp-coding-standards/wpcs": "0.13.1",
"phpunit/phpunit": "6.2.3", "phpunit/phpunit": "6.2.3",
"woocommerce/woocommerce-git-hooks": "1.0.2" "woocommerce/woocommerce-git-hooks": "1.0.3",
"wimg/php-compatibility": "^8.0"
}, },
"scripts": { "scripts": {
"pre-update-cmd": [ "pre-update-cmd": [
@ -21,11 +22,11 @@
"WooCommerce\\GitHooks\\Hooks::preHooks" "WooCommerce\\GitHooks\\Hooks::preHooks"
], ],
"post-install-cmd": [ "post-install-cmd": [
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs", "\"vendor/bin/phpcs\" --config-set installed_paths \"vendor/wp-coding-standards/wpcs,vendor/wimg/php-compatibility\"",
"WooCommerce\\GitHooks\\Hooks::postHooks" "WooCommerce\\GitHooks\\Hooks::postHooks"
], ],
"post-update-cmd": [ "post-update-cmd": [
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs", "\"vendor/bin/phpcs\" --config-set installed_paths \"vendor/wp-coding-standards/wpcs,vendor/wimg/php-compatibility\"",
"WooCommerce\\GitHooks\\Hooks::postHooks" "WooCommerce\\GitHooks\\Hooks::postHooks"
] ]
} }

121
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5268174ad56d2293f14e24b931afeb63", "content-hash": "990370f7f1455724582fc62049c57da5",
"packages": [ "packages": [
{ {
"name": "composer/installers", "name": "composer/installers",
@ -181,37 +181,40 @@
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.6.1", "version": "1.7.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
"reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.4.0" "php": "^5.6 || ^7.0"
}, },
"require-dev": { "require-dev": {
"doctrine/collections": "1.*", "doctrine/collections": "^1.0",
"phpunit/phpunit": "~4.1" "doctrine/common": "^2.6",
"phpunit/phpunit": "^4.1"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"DeepCopy\\": "src/DeepCopy/" "DeepCopy\\": "src/DeepCopy/"
} },
"files": [
"src/DeepCopy/deep_copy.php"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
"description": "Create deep copies (clones) of your objects", "description": "Create deep copies (clones) of your objects",
"homepage": "https://github.com/myclabs/DeepCopy",
"keywords": [ "keywords": [
"clone", "clone",
"copy", "copy",
@ -219,7 +222,7 @@
"object", "object",
"object graph" "object graph"
], ],
"time": "2017-04-12T18:52:22+00:00" "time": "2017-10-19T19:58:43+00:00"
}, },
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
@ -534,16 +537,16 @@
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "5.2.2", "version": "5.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d",
"reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -552,7 +555,7 @@
"php": "^7.0", "php": "^7.0",
"phpunit/php-file-iterator": "^1.4.2", "phpunit/php-file-iterator": "^1.4.2",
"phpunit/php-text-template": "^1.2.1", "phpunit/php-text-template": "^1.2.1",
"phpunit/php-token-stream": "^1.4.11 || ^2.0", "phpunit/php-token-stream": "^2.0",
"sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/code-unit-reverse-lookup": "^1.0.1",
"sebastian/environment": "^3.0", "sebastian/environment": "^3.0",
"sebastian/version": "^2.0.1", "sebastian/version": "^2.0.1",
@ -594,7 +597,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2017-08-03T12:40:43+00:00" "time": "2017-11-03T13:47:33+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@ -972,30 +975,30 @@
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
"version": "2.0.2", "version": "2.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" "reference": "1174d9018191e93cb9d719edec01257fc05f8158"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158",
"reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", "reference": "1174d9018191e93cb9d719edec01257fc05f8158",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.0", "php": "^7.0",
"sebastian/diff": "^2.0", "sebastian/diff": "^2.0",
"sebastian/exporter": "^3.0" "sebastian/exporter": "^3.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^6.0" "phpunit/phpunit": "^6.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.0.x-dev" "dev-master": "2.1.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -1026,13 +1029,13 @@
} }
], ],
"description": "Provides the functionality to compare PHP values for equality", "description": "Provides the functionality to compare PHP values for equality",
"homepage": "http://www.github.com/sebastianbergmann/comparator", "homepage": "https://github.com/sebastianbergmann/comparator",
"keywords": [ "keywords": [
"comparator", "comparator",
"compare", "compare",
"equality" "equality"
], ],
"time": "2017-08-03T07:14:59+00:00" "time": "2017-11-03T07:16:52+00:00"
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
@ -1626,17 +1629,69 @@
"time": "2016-11-23T20:04:58+00:00" "time": "2016-11-23T20:04:58+00:00"
}, },
{ {
"name": "woocommerce/woocommerce-git-hooks", "name": "wimg/php-compatibility",
"version": "1.0.2", "version": "8.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/woocommerce/woocommerce-git-hooks.git", "url": "https://github.com/wimg/PHPCompatibility.git",
"reference": "f0eea8aa392c822f0f3b9cd0b31f92bfa4de6a0c" "reference": "4c4385fb891dff0501009670f988d4fe36785249"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-git-hooks/zipball/f0eea8aa392c822f0f3b9cd0b31f92bfa4de6a0c", "url": "https://api.github.com/repos/wimg/PHPCompatibility/zipball/4c4385fb891dff0501009670f988d4fe36785249",
"reference": "f0eea8aa392c822f0f3b9cd0b31f92bfa4de6a0c", "reference": "4c4385fb891dff0501009670f988d4fe36785249",
"shasum": ""
},
"require": {
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2"
},
"conflict": {
"squizlabs/php_codesniffer": "2.6.2"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1"
},
"type": "phpcodesniffer-standard",
"autoload": {
"psr-4": {
"PHPCompatibility\\": "PHPCompatibility/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Wim Godden",
"role": "lead"
}
],
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.",
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
"keywords": [
"compatibility",
"phpcs",
"standards"
],
"time": "2017-08-07T19:39:05+00:00"
},
{
"name": "woocommerce/woocommerce-git-hooks",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-git-hooks.git",
"reference": "a9ea000877a996c57862aa81f0e61c04d8973d7e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-git-hooks/zipball/a9ea000877a996c57862aa81f0e61c04d8973d7e",
"reference": "a9ea000877a996c57862aa81f0e61c04d8973d7e",
"shasum": "" "shasum": ""
}, },
"type": "scripts", "type": "scripts",
@ -1656,7 +1711,7 @@
} }
], ],
"description": "WooCommerce Git Hooks", "description": "WooCommerce Git Hooks",
"time": "2017-09-27T16:03:36+00:00" "time": "2017-11-09T18:27:22+00:00"
}, },
{ {
"name": "wp-coding-standards/wpcs", "name": "wp-coding-standards/wpcs",

View File

@ -5,6 +5,18 @@
<description>WooCommerce dev PHP_CodeSniffer ruleset.</description> <description>WooCommerce dev PHP_CodeSniffer ruleset.</description>
<!-- Include WPCS and PHPCompatibility paths -->
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs,vendor/wimg/php-compatibility" />
<!-- Exclude paths -->
<exclude-pattern>tests/cli/</exclude-pattern>
<exclude-pattern>apigen/</exclude-pattern>
<exclude-pattern>includes/gateways/simplify-commerce/includes/</exclude-pattern>
<exclude-pattern>includes/libraries/</exclude-pattern>
<exclude-pattern>includes/api/legacy/</exclude-pattern>
<rule ref="PHPCompatibility"/>
<rule ref="WordPress"> <rule ref="WordPress">
<exclude name="WordPress.VIP.RestrictedFunctions" /> <exclude name="WordPress.VIP.RestrictedFunctions" />
<exclude name="WordPress.VIP.OrderByRand" /> <exclude name="WordPress.VIP.OrderByRand" />