From 507bb0340211c3700ab8506a2ba39cd3ef830bbb Mon Sep 17 00:00:00 2001 From: Alexander Lisachenko Date: Thu, 6 Aug 2026 19:59:23 +0000 Subject: [PATCH 1/2] chore: require PHP 8.4 and z-engine ~8.4.0 The library still targeted PHP 7.4/8.0 with z-engine 0.8/0.9. The class extension hook API it relies on (write-property, get-property-pointer, unset-property, interface-gets-implemented) is unchanged in z-engine 8.4, so no source changes are needed - only the platform pins: - composer: php ~8.4.0, lisachenko/z-engine ~8.4.0, explicit ext-ffi, phpunit ^12 - phpunit.xml.dist: migrate to the current schema (filter/whitelist and logging sections are gone) - CI: run on PHP 8.4 with ffi enabled and JIT off (lowest + highest deps), validate the manifest, drop the xdebug coverage run - README: bump the advertised PHP requirement All 8 phpt functional tests pass on PHP 8.4.19 with both dependency sets. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01HRDZ2XsoVuB5uG4qXKL3ny --- .github/workflows/phpunit.yml | 41 ++++++++++++++--------------------- .gitignore | 1 + README.md | 6 ++--- composer.json | 7 +++--- phpunit.xml.dist | 27 ++++++----------------- 5 files changed, 31 insertions(+), 51 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 2cc6b30..1aa4470 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -2,56 +2,47 @@ name: "PHPUnit tests" on: push: + branches: [master] + pull_request: jobs: phpunit: - name: "PHPUnit tests" + name: "PHPUnit tests (PHP ${{ matrix.php-version }}, ${{ matrix.dependencies }})" - runs-on: ${{ matrix.operating-system }} + runs-on: ubuntu-latest strategy: + fail-fast: false matrix: dependencies: - "lowest" - "highest" php-version: - - "7.4" - - "8.0" - operating-system: - - "ubuntu-latest" + - "8.4" steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: - coverage: "xdebug" + coverage: "none" php-version: "${{ matrix.php-version }}" - ini-values: memory_limit=-1 - tools: composer:v2, cs2pr + extensions: ffi + ini-values: memory_limit=-1, ffi.enable=1, opcache.jit=off + tools: composer:v2 - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + - name: "Validate composer manifest" + run: "composer validate --strict --no-check-lock" - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + run: "composer update --prefer-lowest --no-interaction --no-progress" - name: "Install highest dependencies" if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" + run: "composer update --no-interaction --no-progress" - name: "Tests" - run: "XDEBUG_MODE=coverage vendor/bin/phpunit" + run: "vendor/bin/phpunit" diff --git a/.gitignore b/.gitignore index 487a7d6..7c50415 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /vendor/ /build/ composer.lock +.phpunit.result.cache diff --git a/README.md b/README.md index 49b97c3..454920f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ Immutable objects in PHP ----------------- -This library provides native immutable objects for PHP>=7.4.2 +This library provides native immutable objects for PHP>=8.4 [![Build Status](https://img.shields.io/travis/com/lisachenko/immutable-object/master)](https://travis-ci.org/lisachenko/immutable-object) [![GitHub release](https://img.shields.io/github/release/lisachenko/immutable-object.svg)](https://github.com/lisachenko/immutable-object/releases/latest) -[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/) +[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%208.4-8892BF.svg)](https://php.net/) [![License](https://img.shields.io/packagist/l/lisachenko/immutable-object.svg)](https://packagist.org/packages/lisachenko/immutable-object) Rationale @@ -24,7 +24,7 @@ of the PHP itself. Pre-requisites and initialization -------------- -As this library depends on `FFI`, it requires PHP>=7.4 and `FFI` extension to be enabled. +As this library depends on `FFI`, it requires PHP>=8.4 and `FFI` extension to be enabled. To install this library, simply add it via `composer`: ```bash diff --git a/composer.json b/composer.json index 488ac8e..70a593d 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,12 @@ ], "minimum-stability": "stable", "require": { - "php": "^7.4|^8.0", - "lisachenko/z-engine": "^0.8.1|^0.9.1" + "php": "~8.4.0", + "ext-ffi": "*", + "lisachenko/z-engine": "~8.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.5.5" + "phpunit/phpunit": "^12.2" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0c46225..0c6660f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,34 +9,21 @@ ~ with this source code in the file LICENSE. --> - ./tests/ - ./tests/ + ./tests/Functional/ - - + + ./src/ - - - - - - - - - - + + From f1cdfad2d63d04ec009a1560b82b15fb23a1cd6c Mon Sep 17 00:00:00 2001 From: Alexander Lisachenko Date: Thu, 6 Aug 2026 20:13:18 +0000 Subject: [PATCH 2/2] ci: promote workflow to a full CI pipeline and extend dependabot to actions - replace phpunit.yml with ci.yml: a validate/lint gate (composer validate --strict, php -l over src and tests) followed by the test matrix (PHP 8.4, lowest + highest dependency sets, FFI on, JIT off) - dependabot: keep the daily composer updates and add weekly github-actions updates so action pins stay current Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01HRDZ2XsoVuB5uG4qXKL3ny --- .github/dependabot.yml | 5 +++ .github/workflows/ci.yml | 68 +++++++++++++++++++++++++++++++++++ .github/workflows/phpunit.yml | 48 ------------------------- 3 files changed, 73 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/phpunit.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5a98fda..3e529aa 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,8 @@ updates: interval: daily time: "04:00" open-pull-requests-limit: 10 +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7a309f1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + validate: + name: Validate and lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + coverage: none + tools: composer:v2 + + - name: Validate composer manifest + run: composer validate --strict --no-check-lock + + - name: Lint PHP sources + run: | + find src tests -name '*.php' -print0 | xargs -0 -n1 -P4 php -l + + tests: + name: Tests (PHP ${{ matrix.php-version }}, ${{ matrix.dependencies }} deps) + runs-on: ubuntu-latest + needs: validate + + strategy: + fail-fast: false + matrix: + dependencies: + - lowest + - highest + php-version: + - '8.4' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # The JIT rewrites the executor internals z-engine hooks into, so it + # stays off; FFI must be enabled for CLI scripts, not only preloading. + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: ffi + ini-values: memory_limit=-1, ffi.enable=1, opcache.jit=off + coverage: none + tools: composer:v2 + + - name: Install lowest dependencies + if: ${{ matrix.dependencies == 'lowest' }} + run: composer update --prefer-lowest --no-interaction --no-progress + + - name: Install highest dependencies + if: ${{ matrix.dependencies == 'highest' }} + run: composer update --no-interaction --no-progress + + - name: Run test suite + run: vendor/bin/phpunit diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml deleted file mode 100644 index 1aa4470..0000000 --- a/.github/workflows/phpunit.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: "PHPUnit tests" - -on: - push: - branches: [master] - pull_request: - -jobs: - phpunit: - name: "PHPUnit tests (PHP ${{ matrix.php-version }}, ${{ matrix.dependencies }})" - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - dependencies: - - "lowest" - - "highest" - php-version: - - "8.4" - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - extensions: ffi - ini-values: memory_limit=-1, ffi.enable=1, opcache.jit=off - tools: composer:v2 - - - name: "Validate composer manifest" - run: "composer validate --strict --no-check-lock" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Tests" - run: "vendor/bin/phpunit"