Skip to content

Commit d5b16f3

Browse files
committed
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 outweight 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
1 parent 73c5152 commit d5b16f3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.phpcs.xml.dist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,20 @@
5757
<rule ref="PHPCompatibility">
5858
<!-- Exclude PHP constants back-filled by PHPCS. -->
5959
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesce_equalFound"/>
60+
<exclude name="PHPCompatibility.Constants.NewConstants.t_bad_characterFound"/>
61+
<exclude name="PHPCompatibility.Constants.NewConstants.t_fnFound"/>
62+
<exclude name="PHPCompatibility.Constants.NewConstants.t_attributeFound"/>
63+
<exclude name="PHPCompatibility.Constants.NewConstants.t_matchFound"/>
64+
<exclude name="PHPCompatibility.Constants.NewConstants.t_nullsafe_object_operatorFound"/>
65+
<exclude name="PHPCompatibility.Constants.NewConstants.t_name_fully_qualifiedFound"/>
66+
<exclude name="PHPCompatibility.Constants.NewConstants.t_name_qualifiedFound"/>
67+
<exclude name="PHPCompatibility.Constants.NewConstants.t_name_relativeFound"/>
6068
<exclude name="PHPCompatibility.Constants.NewConstants.t_readonlyFound"/>
69+
<exclude name="PHPCompatibility.Constants.NewConstants.t_enumFound"/>
70+
<exclude name="PHPCompatibility.Constants.NewConstants.t_public_setFound"/>
71+
<exclude name="PHPCompatibility.Constants.NewConstants.t_protected_setFound"/>
72+
<exclude name="PHPCompatibility.Constants.NewConstants.t_private_setFound"/>
73+
<exclude name="PHPCompatibility.Constants.RemovedConstants.t_bad_characterFound"/>
6174
</rule>
6275

6376
<!-- Enforce PSR1 compatible namespaces. -->

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"phpcsstandards/phpcsextra": "^1.5.0"
2727
},
2828
"require-dev": {
29-
"phpcompatibility/php-compatibility": "^9.0",
29+
"phpcompatibility/php-compatibility": "^10.0.0@dev",
3030
"phpunit/phpunit": "^8.0 || ^9.0",
3131
"phpcsstandards/phpcsdevtools": "^1.2.0",
3232
"php-parallel-lint/php-parallel-lint": "^1.4.0",
@@ -36,6 +36,8 @@
3636
"ext-iconv": "For improved results",
3737
"ext-mbstring": "For improved results"
3838
},
39+
"minimum-stability": "dev",
40+
"prefer-stable": true,
3941
"config": {
4042
"allow-plugins": {
4143
"dealerdirect/phpcodesniffer-composer-installer": true

0 commit comments

Comments
 (0)