WordPress-Coding-Standards/composer.json
jrfnl a54427a16c
CS: start using PHPCompatibility 10
Long anticipated, finally here: PHPCompatibility 10.0.0-alpha1 🎉

PHPCompatibility 10.0.0 brings huge improvements in both what is being detected (> 50 new sniffs), as well as the detection accuracy for pre-existing sniffs.

Even though still "unstable", it is stable enough for our purposes and the advantages of using it outweigh the disadvantage of it being an unstable version. By setting the `minimum-stability` and `prefer-stable` settings in the `composer.json`, we can ensure that we don't get the `dev-develop` branch, but rather get a `10.0.0` tag, unstable or not.

And what with the improved detection, a number of new PHP token constants previously not flagged, are now flagged, so let's ignore them as PHPCS polyfills these.

Ref:
* https://github.com/PHPCompatibility/PHPCompatibility/wiki/Upgrading-to-PHPCompatibility-10.0
* https://github.com/PHPCompatibility/PHPCompatibility/releases/tag/10.0.0-alpha1
2025-11-23 04:20:03 +01:00

91 lines
3 KiB
JSON

{
"name": "wp-coding-standards/wpcs",
"type": "phpcodesniffer-standard",
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
"keywords": [
"phpcs",
"standards",
"static analysis",
"WordPress"
],
"license": "MIT",
"authors": [
{
"name": "Contributors",
"homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
}
],
"require": {
"php": ">=7.2",
"ext-filter": "*",
"ext-libxml": "*",
"ext-tokenizer": "*",
"ext-xmlreader": "*",
"squizlabs/php_codesniffer": "^3.13.4",
"phpcsstandards/phpcsutils": "^1.1.0",
"phpcsstandards/phpcsextra": "^1.5.0"
},
"require-dev": {
"phpcompatibility/php-compatibility": "^10.0.0@dev",
"phpunit/phpunit": "^8.0 || ^9.0",
"phpcsstandards/phpcsdevtools": "^1.2.0",
"php-parallel-lint/php-parallel-lint": "^1.4.0",
"php-parallel-lint/php-console-highlighter": "^1.0.0"
},
"suggest": {
"ext-iconv": "For improved results",
"ext-mbstring": "For improved results"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"lock": false
},
"scripts": {
"lint": [
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --show-deprecated --exclude vendor --exclude .git"
],
"check-cs": [
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs"
],
"fix-cs": [
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
],
"run-tests": [
"@php ./vendor/phpunit/phpunit/phpunit --filter WordPress ./vendor/squizlabs/php_codesniffer/tests/AllTests.php --no-coverage"
],
"coverage": [
"@php ./vendor/phpunit/phpunit/phpunit --filter WordPress ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
],
"check-complete": [
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness -q ./WordPress"
],
"check-complete-strict": [
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness ./WordPress"
],
"check-all": [
"@lint",
"@check-cs",
"@run-tests",
"@check-complete-strict"
]
},
"scripts-descriptions": {
"lint": "Lint PHP files against parse errors.",
"check-cs": "Run the PHPCS script against the entire codebase.",
"fix-cs": "Run the PHPCBF script to fix all the autofixable violations on the codebase.",
"run-tests": "Run all the unit tests for the WordPress Coding Standards sniffs without code coverage.",
"coverage": "Run all the unit tests for the WordPress Coding Standards sniffs with code coverage.",
"check-complete": "Check if all the sniffs have tests.",
"check-complete-strict": "Check if all the sniffs have unit tests and XML documentation.",
"check-all": "Run all checks (lint, phpcs, feature completeness) and tests."
},
"support": {
"issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki",
"source": "https://github.com/WordPress/WordPress-Coding-Standards"
}
}