From 6191e43afef13bedbe3f4c52057ebc2fece437ce Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 25 Oct 2024 08:17:27 +0200 Subject: [PATCH] Add PHP 8.4 support --- .github/workflows/analyzers.yaml | 4 +++- .github/workflows/code-style.yaml | 3 ++- .github/workflows/tests.yaml | 6 ++++-- .php-cs-fixer.dist.php | 1 + composer.json | 2 +- src/Iso/object_data.php | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/analyzers.yaml b/.github/workflows/analyzers.yaml index 817a50e..d9f1846 100644 --- a/.github/workflows/analyzers.yaml +++ b/.github/workflows/analyzers.yaml @@ -12,7 +12,8 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3', '8.4'] + composer-options: ['--ignore-platform-req=php+'] fail-fast: false name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} steps: @@ -28,3 +29,4 @@ jobs: run: composer update --ignore-platform-req=php+ --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} - name: Run the tests run: composer run psalm + continue-on-error: ${{ matrix.php-versions == '8.4' }} # Infection dependency is causing issues. diff --git a/.github/workflows/code-style.yaml b/.github/workflows/code-style.yaml index 19a6651..be509ee 100644 --- a/.github/workflows/code-style.yaml +++ b/.github/workflows/code-style.yaml @@ -11,7 +11,8 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3', '8.4'] + composer-options: ['--ignore-platform-req=php+'] fail-fast: false name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} steps: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6070bb1..59b8570 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,8 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3', '8.4'] + composer-options: ['--ignore-platform-req=php+'] experimental: [false] fail-fast: false name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} @@ -27,8 +28,9 @@ jobs: ini-values: error_reporting=E_ALL extensions: pcov, mbstring, posix - name: Install dependencies - run: composer update --prefer-dist --no-progress --no-suggest + run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} - name: Run the tests run: composer run tests - name: Check tests quality run: composer run testquality + continue-on-error: ${{ matrix.php-versions == '8.4' }} # Infection is not ready yet. diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 76d2d27..d274fff 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -54,5 +54,6 @@ 'strict_comparison' => true, 'strict_param' => true, 'native_function_invocation' => true, + 'nullable_type_declaration_for_default_null_value' => true, ]) ; diff --git a/composer.json b/composer.json index 1bcaabb..7d67c7c 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ } ], "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 ", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "azjezz/psl": "^2.7 || ^3.0" }, "require-dev": { diff --git a/src/Iso/object_data.php b/src/Iso/object_data.php index 9cc1114..e0a951a 100644 --- a/src/Iso/object_data.php +++ b/src/Iso/object_data.php @@ -17,7 +17,7 @@ * * @psalm-pure */ -function object_data(string $className, Lens $accessor = null): Iso +function object_data(string $className, ?Lens $accessor = null): Iso { /** @var Lens $typedAccessor */ $typedAccessor = $accessor ?? properties();