diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11d9694..8e3ac34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,9 @@ concurrency: jobs: tests: - name: Tests (PHP ${{ matrix.php }}, ${{ matrix.dependencies }} deps) + name: Tests (PHP ${{ matrix.php }}, ${{ matrix.dependencies }} deps${{ matrix.experimental && ', experimental' || '' }}) runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental == true }} strategy: fail-fast: false matrix: @@ -25,6 +26,9 @@ jobs: include: - php: '8.4' dependencies: lowest + - php: '8.6' + dependencies: highest + experimental: true steps: - uses: actions/checkout@v7 @@ -37,6 +41,7 @@ jobs: - uses: ramsey/composer-install@v4 with: dependency-versions: ${{ matrix.dependencies }} + composer-options: ${{ matrix.experimental && '--ignore-platform-req=php+' || '' }} - name: Run test suite run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml diff --git a/AGENTS.md b/AGENTS.md index 0facbe5..49324be 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,11 +7,12 @@ Guidance for AI coding agents working on this repository. Human contributors: se `php-deal/framework` is an AI Design by Contract library for PHP: AI agents turn business specifications into contracted code with the bundled Agent Skill, and the library enforces the contracts. Contracts are native attributes (`#[Verify]`, `#[Ensure]`, `#[Invariant]`, `#[Inherit]`) whose string arguments are PHP expressions. Aspects of -[Go! AOP 4](https://github.com/goaop/framework) weave the annotated classes and evaluate the expressions on every -call. +[Go! AOP](https://github.com/goaop/framework) weave the annotated classes and evaluate the expressions on every call. -- PHP **8.4+** (CI runs 8.4 and 8.5). Do not use PHP 8.5-only features; PHPStan analyses for the 8.4–8.5 range. -- Runtime dependency: `goaop/framework ^4.0` only. Do not add runtime dependencies without a strong reason. +- PHP **8.4+** (CI runs 8.4, 8.5 and an experimental 8.6 job). Do not use PHP 8.5-only features; PHPStan analyses + for the 8.4–8.5 range. +- Runtime dependency: `goaop/framework` only; Composer installs the version that fits the PHP version, so code must + work with every major version `composer.json` allows. Do not add runtime dependencies without a strong reason. - Version 2.x is a major rewrite of 1.x (Doctrine annotations). Keep [UPGRADE-2.0.md](UPGRADE-2.0.md) and [CHANGELOG.md](CHANGELOG.md) in sync with behaviour changes. diff --git a/CHANGELOG.md b/CHANGELOG.md index 41ab559..5e0f24e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ specifications into contracted code and tests. See [UPGRADE-2.0.md](UPGRADE-2.0. ### Changed -- Requires PHP 8.4+ and Go! AOP 4. +- Requires PHP 8.4+ and Go! AOP. - Each contract expression is compiled once and cached; contracts are read once per method and class. - Contracts of parent classes are evaluated in the scope of the declaring class. - Inherited preconditions are checked before the method body. diff --git a/README.md b/README.md index 956986b..32b35df 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ PhpDeal enforces those rules on every call, as native PHP attributes powered by [![Total Downloads](https://img.shields.io/packagist/dt/php-deal/framework.svg)](https://packagist.org/packages/php-deal/framework) [![PHP Version](https://img.shields.io/badge/php-%E2%89%A5%208.4-777BB4.svg?logo=php&logoColor=white)](https://www.php.net/releases/8.4/) [![Agent Skill](https://img.shields.io/badge/Agent%20Skill-design--by--contract-d97757.svg)](skills/design-by-contract/SKILL.md) -[![Go! AOP](https://img.shields.io/badge/Go!%20AOP-4.x-1f6feb.svg)](https://github.com/goaop/framework) +[![Go! AOP](https://img.shields.io/badge/powered%20by-Go!%20AOP-1f6feb.svg)](https://github.com/goaop/framework) [![PHPStan](https://img.shields.io/badge/PHPStan-level%2010-2a5ea7.svg)](https://phpstan.org/user-guide/rule-levels) [![License](https://img.shields.io/packagist/l/php-deal/framework.svg)](LICENSE) @@ -256,8 +256,8 @@ review. Everything in it works without an AI as well, and contracts can be writt ## Setup -PhpDeal 2 requires **PHP 8.4** or newer and is built on **Go! AOP 4**. Contracts are checked only in classes -that Go! AOP weaves, so the kernel must start before they are loaded. +PhpDeal 2 requires **PHP 8.4** or newer and is built on **Go! AOP**. Contracts are checked only in classes that +Go! AOP weaves, so the kernel must start before they are loaded. Initialize the contract kernel once, as early as possible in your front controller or test bootstrap, before the classes with contracts are loaded: diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md index 35d9751..f3f58b7 100644 --- a/UPGRADE-2.0.md +++ b/UPGRADE-2.0.md @@ -15,11 +15,11 @@ Quick checklist Requirements ------------ -| 1.x | 2.0 | -|-----------------------------|-------------------------| -| PHP 7.1 – 7.4 | PHP 8.4+ | -| goaop/framework ^2.3 | goaop/framework ^4.0 | -| doctrine/annotations | native attributes | +| 1.x | 2.0 | +|-----------------------------|-------------------------------------| +| PHP 7.1 – 7.4 | PHP 8.4+ | +| goaop/framework ^2.3 | goaop/framework ^4.0 \|\| ^5.0 | +| doctrine/annotations | native attributes | Annotations become attributes ----------------------------- diff --git a/composer.json b/composer.json index 4a98301..3fc3cd4 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ ], "require": { "php": "^8.4", - "goaop/framework": "^4.0" + "goaop/framework": "^4.0 || ^5.0@dev" }, "require-dev": { "beberlei/assert": "^3.3.3",