Understand how a PHP codebase actually hangs together: what depends on what, who calls a function and with which arguments, where shared state is written, and what can safely be deleted.
Built for procedural and mixed PHP - the kind of code framework tooling never covers. It indexes the whole workspace, keeps up with unsaved edits, and answers in one panel.
Views
file - what the open file depends on and what depends on it, functions and constants listed separately. Follows the editor, or pin it to keep a file in place while you browse.
units - the same graph collapsed to architectural units you define as path globs. Edges inside a unit disappear, leaving only real cross-unit coupling. Exports to Mermaid in one click.
function - every call site of a function or Class::method, showing which
arguments each caller passes, so unused and rarely used parameters become
obvious. It can follow wrapper functions transitively and hide call shapes you
have already reviewed.
globals - the shared-state map. One row per variable: where it is declared, written and read, with the findings first - never assigned (every reader gets null), never read (dead shared state), and declared-then-never-used.
stub - point at a compatibility or bootstrap file and see its functions split into still-used, with call sites, and dead, so it can be shrunk.
issues - layer-rule violations, dependency cycles, duplicate definitions, risky constructs, unused functions with a transitive depth and a safe removal order, orphan files, and hotspots.
Every name links to its definition; every line number jumps to the usage.
Editor integration
- CodeLens - findings only. A healthy function gets no lens at all.
- Go to Definition / Find References - for functions, constants and
Class::method, with no language server required. - Problems panel - layer-rule violations as warnings; duplicate definitions and unused functions optional.
- Parameter hints - parameters no caller ever passes are underlined; hover any parameter to see how often it is actually used.
Layer rules
Name the units of your architecture, then make it enforceable:
"php-deps.units": ["/src/shared/*","/src/domain/*","/src/app/*"],
"php-deps.rules": {
"/src/domain/*": ["/src/shared/*"],
"/src/app/*": ["/src/domain/*","/src/shared/*"]
}
Each listed unit may depend only on itself plus the units allowed to it. Any other edge becomes a warning on the exact call line. Units with no entry are unrestricted, so rules can be adopted one unit at a time.
Limits
Static analysis, honestly scoped:
->method()is dynamic dispatch and stays invisible;Class::method()is resolved.- Variable functions,
call_user_funcand string callables are invisible too, so the unused list is a review list rather than a verdict. - Names resolve by trailing name - intended for non-namespaced codebases.
Requirements
PHP 8.1 or newer on PATH, or set php-deps.php to the binary. Nothing else to
install.
Settings
Everything lives under php-deps.*: units and layer rules, include and exclude
globs, CodeLens and Problems toggles, and analysis limits. The settings UI lists
them all with descriptions.
License
MIT