Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -25,6 +26,9 @@ jobs:
include:
- php: '8.4'
dependencies: lowest
- php: '8.6'
dependencies: highest
experimental: true
steps:
- uses: actions/checkout@v7

Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------------
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading