arkitect
PHPArkitect is a PHP testing framework that lets developers write architectural rules as code and verify them in CI/CD pipelines. It prevents architectural violations (e.g., domain layers depending on infrastructure) by running checks alongside your test suite.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | phparkitect/arkitect |
| Owner | phparkitect |
| Primary language | PHP |
| License | MIT — OSI-approved |
| Stars | 922 |
| Forks | 52 |
| Open issues | 38 |
| Latest release | 1.2.0 (2026-07-02) |
| Last updated | 2026-07-04 |
| Source | https://github.com/phparkitect/arkitect |
What arkitect is
PHPArkitect parses PHP source code to extract class dependencies, namespaces, and metadata, then evaluates user-defined rules (selectors + conditions + assertions) expressed as fluent PHP objects. It supports multiple output formats (text, JSON, GitLab) and integrates with CI/CD via CLI with baseline support for gradual enforcement.
Get the arkitect source
Clone the repository and explore it locally.
git clone https://github.com/phparkitect/arkitect.gitcd arkitect# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Config file (phparkitect.php) must be maintained as codebase evolves; rule complexity grows with architecture maturity—start simple and add rules incrementally.
- Parser targets specific PHP versions (8.0–8.5); ensure target version matches your runtime to avoid attribute/syntax mismatches.
- Baseline files (phparkitect-baseline.json) require careful version control; line number sensitivity can cause false failures if baseline tracking is disabled.
- Custom annotation parsing is enabled by default; disable it if your project uses Doctrine, Symfony, or other annotation-heavy frameworks to reduce parse time.
- Integration with existing test suites is seamless (Composer dev dependency), but requires deliberate CI/CD step to fail builds on violations.
When to avoid it — and what to weigh
- Non-PHP Codebases — PHPArkitect is PHP-only; projects using other languages (Python, Node.js, Java) need dedicated architecture testing tools.
- Real-Time Runtime Enforcement Needed — PHPArkitect is a static analysis tool run at build/test time. It cannot enforce architecture at runtime or prevent instantiation of violating classes dynamically.
- Dynamic or Eval-Based Code — Projects heavily reliant on reflection, dynamic class loading, or eval() may have unparseable dependencies that PHPArkitect cannot reliably detect.
- No CI/CD Pipeline — Without automated testing infrastructure, adoption requires manual discipline to run checks locally, reducing effectiveness as a safety net.
License & commercial use
MIT License (OSI-compliant, permissive). Permits commercial use, modification, and distribution with minimal restrictions (attribution required).
MIT is a permissive, OSI-approved license. Commercial use is explicitly permitted. No warranty or liability guarantees; typical for open-source tooling. Review your organization's legal stance on MIT-licensed dev dependencies if required by policy.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Strong |
| Assessment confidence | High |
PHPArkitect is a static analysis tool; it does not execute user code or make network calls. Security posture depends on: (1) integrity of parsed PHP files (PHPArkitect does not validate them), (2) Composer supply chain (transitive dependencies), (3) baseline file tampering (could hide violations if not version-controlled). No known CVEs stated in data. Parsing custom annotations is enabled by default—consider disabling if parsing untrusted annotation syntax.
Alternatives to consider
Deptrac
Mature static analysis tool for PHP dependency graphs; more flexible layer and rule definitions; larger community. More complex setup; less integrated with modern PHP tooling.
PhpStan with custom rules
General-purpose static analyzer with extension API; broader scope (type checking + architecture). Steeper learning curve for custom rule development; less specialized for architecture.
SonarQube
Enterprise-grade code quality platform supporting multiple languages and detailed architecture analysis. Significant operational overhead; cloud/self-hosted; not lightweight.
Build on arkitect with DEV.co software developers
PHPArkitect makes it easy to define and validate architectural rules alongside your test suite. Start with a simple rule, integrate into CI/CD, and catch violations early.
Talk to DEV.coRelated on DEV.co
Explore the category and the services that help you build with it.
arkitect FAQ
Does PHPArkitect prevent violations at runtime?
Can I use PHPArkitect with legacy codebases?
What PHP versions are supported?
Does PHPArkitect slow down CI/CD?
Software developers & web developers for hire
DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If arkitect is part of your open-source testing roadmap, our team can implement, customize, migrate, and maintain it.
Enforce architecture as code in your PHP projects
PHPArkitect makes it easy to define and validate architectural rules alongside your test suite. Start with a simple rule, integrate into CI/CD, and catch violations early.