From 051b81791f937c4efc1045567b06b52025a2306f Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 23 Nov 2025 04:34:20 +0100 Subject: [PATCH] CS: start using PHPCompatibility 10 Long anticipated, finally here: PHPCompatibility 10.0.0-alpha1 :tada: 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. Includes updating the PHPCS version constraints to match. Includes updating the exclusions in the ruleset for changes in the error codes due to further changes in PHP having been made (and now being detected). Ref: * https://github.com/PHPCompatibility/PHPCompatibility/wiki/Upgrading-to-PHPCompatibility-10.0 * https://github.com/PHPCompatibility/PHPCompatibility/releases/tag/10.0.0-alpha1 --- composer.json | 6 ++++-- phpcs.xml.dist | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 05b05c75..6af16647 100644 --- a/composer.json +++ b/composer.json @@ -42,8 +42,8 @@ "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcompatibility/php-compatibility": "^9.3.5", - "squizlabs/php_codesniffer": "^3.7.2", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "squizlabs/php_codesniffer": "^3.13.5", "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { @@ -58,6 +58,8 @@ "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, + "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "PHPMailer\\PHPMailer\\": "src/" diff --git a/phpcs.xml.dist b/phpcs.xml.dist index e2d1e5c6..5642fd91 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -30,9 +30,9 @@ - + - +