Static analysis without loading the application
ArchUnitPHP
Architecture testing for PHP. The PHP foundation focuses on static source analysis, honest Composer autoload resolution, lazy immutable rules, and structured violations. It is designed to integrate with PHPUnit and Pest without coupling the core to either.
Roadmap
Follow the public foundation backlog$rule = ArchUnit::projectFiles()
->inFolder('src/Api/**')
->shouldNot()
->dependOnFiles()
->inFolder('src/Infrastructure/**');
ArchAssert::passes($rule);The ecosystem
PHP, in context.
PHP is a dynamic language built for the web and deployed across everything from small sites to major commerce platforms. Modern PHP adds strong typing features, Composer manages packages and autoloading, and frameworks such as Laravel and Symfony give large applications a clear structure to protect.
Web applications, APIs, commerce, and content platforms
Composer, Laravel, Symfony, PHPUnit, and Pest
Planned static analysis without loading the application
Adoption snapshot
Public adoption, in context.
Packagist publishes download statistics for Composer packages, but the ArchUnitPHP README currently describes a delivery skeleton with no package to install.
- Package status
- No Composer package published Public totals after publication
- Reported history
- Unavailable No package published
- Latest 30 days
- Unavailable No package published
- GitHub stars
- 0 Snapshot of October 4, 2026
Capabilities
What ArchUnitPHP brings to the test suite.
The family shares a recognizable architecture vocabulary while each implementation stays honest about its language, toolchain, and maturity.
Composer autoloading and symbol resolution
Lazy and immutable rule builders
PHPUnit and Pest integration targets
Structured violations
Pure graph and end-to-end test boundaries
Go deeper
Start with Composer-aware boundaries.
The target API resolves namespaces through Composer before it evaluates dependency rules. This example is illustrative while the public foundation work is still underway.
$rule = ArchUnit::projectFiles()
->inFolder('src/Domain/**')
->shouldNot()
->dependOnFiles()
->inFolder('src/Http/**');
ArchAssert::passes($rule);Documentation highlights
Work with ArchUnitPHP beyond the quickstart.
ArchUnitPHP is a delivery skeleton with an explicit design direction. It is not presented as a released package, and the current documentation separates intended behavior from shipped behavior.
Resolve PHP without booting the app
The planned extraction layer will read PHP source and Composer autoloading information without loading or executing application code.
- Namespaces, use declarations, includes, and symbol dependencies need source-backed resolution.
- Composer source roots and package boundaries must remain visible rather than being inferred from conventions alone.
- Dynamic runtime behavior will require explicit limits instead of guessed graph edges.
Keep rules portable and PHP-native
The target grammar mirrors the family while preserving PHP method chaining and ecosystem conventions.
- Lazy, immutable builders will describe the rule before project analysis begins.
- Structured violations keep the core independent from PHPUnit and Pest.
- Pure graph algorithms can be tested apart from real-project extraction.
Make maturity impossible to misread
The repository currently tracks foundation work only, so examples describe direction rather than a Composer package users can install.
- There is no published package or supported PHP matrix yet.
- The issue backlog owns API and delivery decisions.
- The planned status remains visible alongside every call to action.
Current maturity
Foundation stage
A public delivery skeleton and design target, not a Composer package or released API yet.
Where it fits
Put boundaries next to the code they protect.
Common starting points for ArchUnitPHP include the following project shapes.
More ecosystems
The same intent, expressed natively.
Explore sibling implementations and carry the architecture vocabulary across a polyglot system.
Make the first boundary executable.
Add one meaningful rule, run it with the existing tests, and grow the architecture suite as the system reveals where it needs protection.
Start with ArchUnitPHP ↗