Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. PHP Architecture Tester

PHP Architecture Tester

MITPHP0.12.4

A PHPStan extension for verifying architectural rules in PHP code using natural language definitions.

Visit WebsiteGitHubGitHub
1.3k stars61 forks0 contributors

What is PHP Architecture Tester?

PHP Architecture Tester (PHPat) is a PHPStan extension that allows developers to define and test architectural rules in their PHP codebases. It solves the problem of architectural drift by providing automated validation of dependency constraints, layer boundaries, and other structural requirements. The tool integrates directly into the static analysis workflow, catching violations early in the development process.

Target Audience

PHP developers and teams working on medium to large codebases who need to maintain architectural consistency and prevent dependency violations. Particularly valuable for projects with layered architectures, domain-driven design, or strict separation of concerns.

Value Proposition

PHPat offers a unique combination of PHPStan integration and natural language rule definitions, making architectural testing accessible without complex configuration. Unlike manual code reviews or documentation, it provides automated, repeatable validation that scales with the codebase.

Overview

✔️ PHP Architecture Tester - Easy architecture testing for PHP

Use Cases

Best For

  • Enforcing layered architecture in PHP applications
  • Preventing circular dependencies between modules
  • Validating dependency direction in domain-driven design
  • Maintaining clean separation between infrastructure and domain layers
  • Automating architecture compliance in CI/CD pipelines
  • Testing adherence to predefined coding standards and patterns

Not Ideal For

  • Projects not using PHPStan for static analysis
  • Teams with rapidly evolving architectures that undergo frequent breaking changes
  • Developers seeking graphical or UI-based tools for architecture visualization
  • Codebases with heavy reliance on dynamic or runtime dependencies that static analysis cannot validate

Pros & Cons

Pros

Natural Language Rules

Allows defining architectural constraints in intuitive, human-readable syntax, as demonstrated in the example GIF, making it accessible without deep technical jargon.

Seamless PHPStan Integration

Works as an extension to PHPStan, leveraging existing static analysis setups without requiring additional tools, as highlighted in the automatic activation via extension installer.

Automated Compliance Testing

Scans the entire codebase to automatically verify adherence to rules, catching violations early in development, which is core to its philosophy of testable architecture.

Flexible Rule Support

Supports a wide range of architectural patterns, such as layered boundaries and dependency constraints, per the documentation examples, enabling customization for various project needs.

Cons

Unstable Pre-1.0 API

As warned in the README, early-stage releases (0.x.x) may introduce breaking changes, making it risky for production environments that require stability.

PHPStan Dependency Overhead

Requires PHPStan ^2.1 to function, adding complexity for projects not already using static analysis or those with incompatible versions.

Rule Definition Complexity

While natural language simplifies setup, creating comprehensive architectural rules can still be time-consuming and may require deep understanding of the codebase structure.

Frequently Asked Questions

Quick Stats

Stars1,275
Forks61
Contributors0
Open Issues12
Last commit12 days ago
CreatedSince 2019

Tags

#composer#linter#dev-tools#dependency-management#code-quality#testing#architecture-testing#php#phpstan-extension#architecture#static-analysis

Built With

P
PHPStan
P
PHP

Links & Resources

Website

Included in

PHP32.5kStatic Analysis & Code Quality14.5k
Auto-fetched 1 day ago

Related Projects

PHP ParserPHP Parser

A PHP parser written in PHP

Stars17,454
Forks1,133
Last commit1 month ago
TypeScript ESLintTypeScript ESLint

:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

Stars16,366
Forks2,976
Last commit1 day ago
pyrightpyright

Static Type Checker for Python

Stars15,596
Forks1,804
Last commit1 day ago
PHPStanPHPStan

PHP Static Analysis Tool - discover bugs in your code without running it!

Stars14,078
Forks961
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub