From d786a083937ca9a3b33ea779db3c5623d2dfec33 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 20:51:40 +0000 Subject: [PATCH 1/5] Allow goaop/framework 5.x Go! AOP 5 is the 4.x line for PHP 8.5+ with the same API, so the constraint becomes ^4.0 || ^5.0 and Composer picks the version that fits the PHP version. The whole suite (style, PHPStan, tests, demo) passes against 5.x-dev. CI gets a PHP 8.5 job that requires goaop/framework 5.x-dev until 5.0.0 is tagged. README, CHANGELOG, UPGRADE-2.0 and AGENTS.md mention both versions. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1Cr7rZzUgw16qS4vNV --- .github/workflows/ci.yml | 10 +++++++++- AGENTS.md | 7 ++++--- CHANGELOG.md | 2 +- README.md | 7 ++++--- UPGRADE-2.0.md | 10 +++++----- composer.json | 2 +- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11d9694..da90f73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ concurrency: jobs: tests: - name: Tests (PHP ${{ matrix.php }}, ${{ matrix.dependencies }} deps) + name: Tests (PHP ${{ matrix.php }}, ${{ matrix.dependencies }} deps${{ matrix.goaop && format(', goaop {0}', matrix.goaop) || '' }}) runs-on: ubuntu-latest strategy: fail-fast: false @@ -25,6 +25,10 @@ jobs: include: - php: '8.4' dependencies: lowest + # Go! AOP 5 (PHP 8.5+) has no stable release yet; drop this entry once 5.0.0 is tagged + - php: '8.5' + dependencies: highest + goaop: 5.x-dev steps: - uses: actions/checkout@v7 @@ -34,6 +38,10 @@ jobs: coverage: pcov tools: composer:v2 + - name: Require Go! AOP ${{ matrix.goaop }} + if: matrix.goaop + run: composer require --no-update --no-interaction "goaop/framework:${{ matrix.goaop }}" + - uses: ramsey/composer-install@v4 with: dependency-versions: ${{ matrix.dependencies }} diff --git a/AGENTS.md b/AGENTS.md index 0facbe5..b724cdb 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 4 or 5](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. +- Runtime dependency: `goaop/framework ^4.0 || ^5.0` only. Go! AOP 5 needs PHP 8.5 and has the same API as 4.x, + so code must work with both. 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..d93b5c7 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 4 or 5 (`goaop/framework ^4.0 || ^5.0`; Go! AOP 5 requires PHP 8.5). - 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..ed7d031 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/Go!%20AOP-4.x%20%7C%205.x-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,9 @@ 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 4 or 5** (Go! AOP 5 needs PHP 8.5; Composer picks +the version that fits your PHP). 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..b099837 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" }, "require-dev": { "beberlei/assert": "^3.3.3", From 95cacf2588a59e4fe231a5e8c2dd035ac6549b84 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 21:26:25 +0000 Subject: [PATCH 2/5] Install Go! AOP 5.x-dev through the constraint instead of a CI job `^5.0@dev` lets the PHP 8.5 jobs pick 5.x-dev until 5.0.0 is tagged and then the stable release, without a dedicated matrix entry. The flag only affects this repository's own installs: Composer ignores stability flags of dependencies. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1Cr7rZzUgw16qS4vNV --- .github/workflows/ci.yml | 10 +--------- AGENTS.md | 3 ++- composer.json | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da90f73..11d9694 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ concurrency: jobs: tests: - name: Tests (PHP ${{ matrix.php }}, ${{ matrix.dependencies }} deps${{ matrix.goaop && format(', goaop {0}', matrix.goaop) || '' }}) + name: Tests (PHP ${{ matrix.php }}, ${{ matrix.dependencies }} deps) runs-on: ubuntu-latest strategy: fail-fast: false @@ -25,10 +25,6 @@ jobs: include: - php: '8.4' dependencies: lowest - # Go! AOP 5 (PHP 8.5+) has no stable release yet; drop this entry once 5.0.0 is tagged - - php: '8.5' - dependencies: highest - goaop: 5.x-dev steps: - uses: actions/checkout@v7 @@ -38,10 +34,6 @@ jobs: coverage: pcov tools: composer:v2 - - name: Require Go! AOP ${{ matrix.goaop }} - if: matrix.goaop - run: composer require --no-update --no-interaction "goaop/framework:${{ matrix.goaop }}" - - uses: ramsey/composer-install@v4 with: dependency-versions: ${{ matrix.dependencies }} diff --git a/AGENTS.md b/AGENTS.md index b724cdb..68cb255 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,8 @@ 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 || ^5.0` only. Go! AOP 5 needs PHP 8.5 and has the same API as 4.x, - so code must work with both. Do not add runtime dependencies without a strong reason. + so code must work with both. Until 5.0.0 is released, `composer.json` says `^5.0@dev`, so that CI on PHP 8.5 runs + against 5.x-dev; remove `@dev` after the release. 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/composer.json b/composer.json index b099837..3fc3cd4 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ ], "require": { "php": "^8.4", - "goaop/framework": "^4.0 || ^5.0" + "goaop/framework": "^4.0 || ^5.0@dev" }, "require-dev": { "beberlei/assert": "^3.3.3", From 4b05acbffb39978f7d4c37645f3b7ca8afcbfc2b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 21:27:27 +0000 Subject: [PATCH 3/5] Add an experimental PHP 8.6 CI job, drop Go! AOP versions from the docs The PHP 8.6 job may fail without failing the build and ignores the upper PHP bounds of dependencies. AGENTS.md and the changelog no longer name Go! AOP versions: composer.json decides them. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1Cr7rZzUgw16qS4vNV --- .github/workflows/ci.yml | 7 ++++++- AGENTS.md | 11 +++++------ CHANGELOG.md | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) 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 68cb255..49324be 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,13 +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 or 5](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 || ^5.0` only. Go! AOP 5 needs PHP 8.5 and has the same API as 4.x, - so code must work with both. Until 5.0.0 is released, `composer.json` says `^5.0@dev`, so that CI on PHP 8.5 runs - against 5.x-dev; remove `@dev` after the release. 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 d93b5c7..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 or 5 (`goaop/framework ^4.0 || ^5.0`; Go! AOP 5 requires PHP 8.5). +- 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. From 994efb55e34fe13f69d659672399e22cbcd37d18 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 21:28:28 +0000 Subject: [PATCH 4/5] Drop Go! AOP versions from the README setup section Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1Cr7rZzUgw16qS4vNV --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ed7d031..cd57028 100644 --- a/README.md +++ b/README.md @@ -256,9 +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 or 5** (Go! AOP 5 needs PHP 8.5; Composer picks -the version that fits your PHP). 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: From 8dc9eacb8303d9fa110c2c97a6265ec1f0c4f391 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 21:29:51 +0000 Subject: [PATCH 5/5] Drop Go! AOP versions from the README badge Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1Cr7rZzUgw16qS4vNV --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd57028..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%20%7C%205.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)