From 0a0851c347c0273afcce01856b2dffd20880123e Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 16 Aug 2026 22:25:07 +0200 Subject: [PATCH] Composer: raise the minimum supported PHPCS/Utils versions PHP_CodeSniffer released security versions the other week, so unless security advisories would be actively ignored, CI will fail on a failure to install for `lowest`. Along the same lines, PHPCSUtils released a security version a week before that. As it would be prudent to encourage users to upgrade anyhow, I'm proposing to raise the minimum supported PHPCS/Utils versions to get round the CI issue. Alternatively, it could be chosen to not raise the minimum version, but to ignore the security advisories in CI. As the difference between the "old" vs "new" versions for PHPCS is relatively small, I'm suggesting to just bump the versions. Includes updating the README and the GHA workflows to match. Refs: * https://github.com/PHPCSStandards/PHP_CodeSniffer/releases#release-3.13.6 * https://github.com/PHPCSStandards/PHP_CodeSniffer/releases#release-4.0.2 * https://github.com/PHPCSStandards/PHPCSUtils/releases --- .github/workflows/test.yml | 62 +++++++++----------------------------- README.md | 4 +-- composer.json | 4 +-- 3 files changed, 18 insertions(+), 52 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8984d9a..80d7deb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,80 +25,46 @@ jobs: # as well as add extra jobs in `include`. # @link https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix # - # IMPORTANT: test runs shouldn't fail because of PHPCS being incompatible with a PHP version. - # - PHPCS will run without errors on PHP 5.4 - 7.4 on all supported PHPCS versions. - # - PHP 8.0 needs PHPCS 3.5.7+ to run without errors. - # - PHP 8.1 needs PHPCS 3.6.1+ to run without errors. - # - PHP 8.2 needs PHPCS 3.6.1+ to run without errors. - # - PHP 8.3 needs PHPCS 3.8.0+ to run without errors (though the errors don't affect this package). - # - PHP 8.4 needs PHPCS 3.11.0+ to run without errors (though the errors don't affect this package). - # - PHP 8.5 needs PHPCS 3.13.4+ to run without errors. - # # The matrix is set up so as not to duplicate the builds which are run for code coverage. - php: ["5.5", "5.6", "7.0", "7.1", "7.2", "7.3"] - phpcs_version: ["3.13.5", "4.0.0", "4.x-dev"] + php: ["5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"] + phpcs_version: ["3.13.6", "4.0.2", "4.x-dev"] exclude: # PHPCS 4.x requires PHP 7.2+ - php: "5.5" - phpcs_version: "4.0.0" + phpcs_version: "4.0.2" - php: "5.5" phpcs_version: "4.x-dev" - php: "5.6" - phpcs_version: "4.0.0" + phpcs_version: "4.0.2" - php: "5.6" phpcs_version: "4.x-dev" - php: "7.0" - phpcs_version: "4.0.0" + phpcs_version: "4.0.2" - php: "7.0" phpcs_version: "4.x-dev" - php: "7.1" - phpcs_version: "4.0.0" + phpcs_version: "4.0.2" - php: "7.1" phpcs_version: "4.x-dev" - include: - - php: "8.5" - phpcs_version: "4.0.0" + # Exclude builds which are run with code coverage, so as not to duplicate these. - php: "8.5" - phpcs_version: "3.13.5" - - - php: "8.4" - phpcs_version: "4.x-dev" - - php: "8.4" - phpcs_version: "3.13.5" - - - php: "8.3" - phpcs_version: "4.x-dev" - - php: "8.3" - phpcs_version: "3.13.5" - - - php: "8.2" - phpcs_version: "4.x-dev" - - php: "8.2" - phpcs_version: "3.13.5" - - - php: "8.1" phpcs_version: "4.x-dev" - - php: "8.1" - phpcs_version: "3.13.5" - - - php: "8.0" - phpcs_version: "4.x-dev" - - php: "8.0" - phpcs_version: "3.13.5" - - php: "7.4" + phpcs_version: "3.13.6" + - php: "7.2" phpcs_version: "4.x-dev" + include: # Experimental builds. - php: "8.6" # Nightly. phpcs_version: "4.x-dev" - name: "Test: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}" - continue-on-error: ${{ matrix.php == '8.6' }} + name: "Test: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}" + steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -172,12 +138,12 @@ jobs: - php: "8.5" phpcs_version: "4.x-dev" - php: "7.4" - phpcs_version: "3.13.5" + phpcs_version: "3.13.6" - php: "7.2" phpcs_version: "4.x-dev" - php: "5.4" - phpcs_version: "3.13.5" + phpcs_version: "3.13.6" name: "Coverage: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}" diff --git a/README.md b/README.md index a1b4260..f9aeb4c 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problemati ### Requirements -VariableAnalysis requires PHP 5.4 or higher and [PHP CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) version 3.13.5 or higher. +VariableAnalysis requires PHP 5.4 or higher and [PHP CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) version 3.13.6 or higher. -It also depends on [PHPCSUtils](https://github.com/PHPCSStandards/PHPCSUtils) version 1.0 or higher. If you install VariableAnalysis with Composer (the recommended method below), this dependency is installed for you automatically. If you install it standalone, you must install PHPCSUtils yourself; see the [Standalone](#standalone) instructions. +It also depends on [PHPCSUtils](https://github.com/PHPCSStandards/PHPCSUtils) version 1.2.3 or higher. If you install VariableAnalysis with Composer (the recommended method below), this dependency is installed for you automatically. If you install it standalone, you must install PHPCSUtils yourself; see the [Standalone](#standalone) instructions. ### With PHPCS Composer Installer diff --git a/composer.json b/composer.json index b4cf2fa..0a4e719 100644 --- a/composer.json +++ b/composer.json @@ -51,8 +51,8 @@ }, "require": { "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.0", - "phpcsstandards/phpcsutils": "^1.0" + "squizlabs/php_codesniffer": "^3.13.6 || ^4.0.2", + "phpcsstandards/phpcsutils": "^1.2.3" }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3",