Generates OpenAPI documents from PHP source. Two pipelines: classic (docblock annotations
and OpenApi\Attributes) and spec (OpenApi\Spec), with a hybrid bridge between them.
ROADMAP.md covers where they are heading.
Terminology is defined in CONTEXT.md. Classic and spec deliberately use different words for similar things — check there before naming anything.
All tooling runs through composer:
composer lint— code style check (cs-fixer + rector, dry run)composer cs/composer rector— apply style fixescomposer analyse— static analysis (phpstan)composer test— unit tests (add-- --filter ClassNamefor a single class)composer docs:gen— regenerate the reference docscomposer redocly— validate generated specs against the OpenAPI schemacomposer docs:dev— local docs preview; long-running, never returns
Read the relevant page before working in that part of the tree:
| Page | Covers |
|---|---|
| docs/dev/pipeline.md | spec pipeline internals — slot maps, mutability, augmenter ordering, where new code goes |
| docs/dev/testing.md | data providers, the tests/Concerns helpers, how documentation is test-verified |
| docs/dev/docs-toolchain.md | which documentation is generated, and the CLI's rough edges |
| docs/dev/writing-docs.md | conventions for hand-written documentation, and a checklist for reviewing doc changes |
| docs/dev/messages.md | the form of spec pipeline messages, and which level each takes |
- No
finalon classes or methods, value objects included, andprotectedoverprivatefor methods and properties, so downstream can subclass - Protected members are not a frozen API: a protected method can change its signature without a deprecation. What stays stable is the user-facing side: attributes, public methods, the contracts users implement and the extension points the docs describe
- Docblocks open with a one-sentence summary and an empty line, see docs/dev/writing-docs.md
- British spelling in
src/, US indocs/— follow whichever is local to the file - New pipeline work goes in
src/Spec/,src/Augmenter/,src/Compiler/;src/Annotations/andsrc/Attributes/are classic and closed to new capabilities, with one carve-out: an OpenAPI construct classic claims to model but cannot express is a spec-compliance defect, and fixing it is in scope — ROADMAP.md has the v7/v8 plan - Repeated docblock unions get a
@phpstan-typealias, imported with@phpstan-import-type— seeBuilderSourceonBuilder - Branches are
type/short-description; commits aretype(Scope): subject(feat,fix,docs,test,chore,refactor) — CONTRIBUTING covers what a message body should contain
See CONTRIBUTING.md for the full checklist. The short version:
composer test, composer analyse, and composer docs:gen leaving no diff.