From a041ac97db7145ab79d99692ae1d63c4c2e8bbb4 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Wed, 4 Dec 2024 09:39:33 -0500 Subject: [PATCH] Add PHP 8.4 as supported (#900) * Add PHP 8.4 as supported * Add temporary workaround that manually install psalm on currently supported versions --- .github/workflows/ci.yml | 7 +++++-- README.md | 2 +- composer.json | 3 +-- tests/check_coding_standards.sh | 7 +++++++ tests/ci.sh | 13 +++++++++++++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb6ae59..9ec098f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,9 +20,10 @@ jobs: - '8.1' - '8.2' - '8.3' + - '8.4' future-release: [false] include: - - php-version: '8.4' + - php-version: '8.5' future-release: true fail-fast: false name: PHP ${{ matrix.php-version }} @@ -47,4 +48,6 @@ jobs: - name: Static analysis run: 'vendor/bin/psalm --config="tests/psalm.xml"' - if: ${{ !matrix.future-release }} + # TODO: Remove exclusion that skips running psalm on PHP 8.4 when psalm + # supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107). + if: ${{ !matrix.future-release && matrix.php-version < 8.4 }} diff --git a/README.md b/README.md index 823d523..f960777 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Installation instructions to use the `composer` command can be found on https:// ### 📋 Requirements -PHP Curl Class works with PHP 8.3, 8.2, 8.1, 8.0, and 7.4. +PHP Curl Class works with PHP 8.4, 8.3, 8.2, 8.1, 8.0, and 7.4. ### 🚀 Quick Start and Examples diff --git a/composer.json b/composer.json index 8da6c71..89fb33a 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,7 @@ "phpcompatibility/php-compatibility": "dev-develop", "phpcsstandards/phpcsutils": "@alpha", "phpunit/phpunit": "*", - "squizlabs/php_codesniffer": "*", - "vimeo/psalm": ">=5.26.1" + "squizlabs/php_codesniffer": "*" }, "suggest": { "ext-mbstring": "*" diff --git a/tests/check_coding_standards.sh b/tests/check_coding_standards.sh index b1ab3a6..6c45a84 100755 --- a/tests/check_coding_standards.sh +++ b/tests/check_coding_standards.sh @@ -114,6 +114,11 @@ if [[ "${?}" -ne 0 ]]; then errors+=("found PHP_CodeSniffer coding standard violation(s)") fi +# TODO: Remove this workaround that only runs php-cs-fixer on PHP < 8.4 when +# php-cs-fixer supports PHP 8.4. +# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8300 +if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then + # Run PHP-CS-Fixer. vendor/bin/php-cs-fixer --version vendor/bin/php-cs-fixer fix --ansi --config="tests/.php-cs-fixer.php" --diff --dry-run @@ -121,3 +126,5 @@ if [[ "${?}" -ne 0 ]]; then echo "Error: found PHP-CS-Fixer coding standard violation(s)" errors+=("found PHP-CS-Fixer coding standard violation(s)") fi + +fi diff --git a/tests/ci.sh b/tests/ci.sh index 6b5489c..c3d6d76 100755 --- a/tests/ci.sh +++ b/tests/ci.sh @@ -60,6 +60,19 @@ phpunit_v10_shim() { set -x composer self-update + +# TODO: Add "vimeo/psalm" back into composer.json under "require-dev" when +# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): +# "require-dev": { +# "vimeo/psalm": ">=5.26.1" +# }, +# +# TODO: Remove this workaround that only installs vimeo/psalm on PHP < 8.4 when +# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): +if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then + composer require --dev "vimeo/psalm:>=5.26.1" +fi + composer install --prefer-source --no-interaction # Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable.