Implementation of the idea of the blog post:
https://github.com/voku/itp-context/
Use PHP attributes when the rule belongs to the code
Every serious codebase has rules.
Not formatting rules. Those are easy. Let PHP-CS-Fixer, PHP_CodeSniffer, Rector, PHPStan, and your IDE handle the boring whitespace police work.
I mean the rules that decide whether the system survives:
external APIs must stay behind adapters
domain code must not know HTTP clients
persistence must go through repositories
legacy compatibility must stay isolated
security validation must happen before data crosses a boundary
These rules exist in every real project.
The problem is where they live.
Usually, they live in someone’s head, an old ticket, a forgotten ADR, or a Confluence page that looks official and is already wrong.
That is documentation theater.
Everyone pretends the architecture is documented.…