fix(php): resolve instance-method calls edges from typed receivers (#1682) - #2492
fix(php): resolve instance-method calls edges from typed receivers (#1682)#2492filipechagas wants to merge 15 commits into
Graphify — looks good
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Details
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR implements PHP typed-receiver resolution for member calls in the graphify extractor. It adds support for resolving calls like $this->prop->method(), nullsafe receivers ($obj?->method()), constructor-promoted params, new T() locals, and inline (new Service())->method() forms, binding them to the receiver's declared type (INFERRED 0.8, or EXTRACTED 1.0 for the corroborated inline form), while emitting no edge in ambiguous cases. It also scopes the PHP and Objective-C member-call resolvers to their own language's source suffixes, threads new node markers (_php_non_class_types/_php_interfaces) through the CLI dispatch context, and bumps the version to roll the AST cache namespace. The surface area spans graphify/cli.py (context marker propagation), graphify/extract.py (PHP config call types, resolver logic), graphify/watch.py, documentation (CHANGELOG.md, docs/how-it-works.md), and a substantial set of tests covering member-call resolution, refusal behavior, polyglot scoping, and watch/incremental-rebuild scenarios.
No blocking issues surfaced. 3 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 2159 functions depend on the 1088 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
extract()— 371 callers, 40 callees - worse:
_rebuild_code()— 92 callers, 51 callees - worse:
_extract_generic()— 18 callers, 23 callees - worse:
walk()— 1 callers, 53 callees - new:
_full_then_incremental()— 9 callers, 3 callees - worse:
walk_calls()— 1 callers, 14 callees - new:
_php_method_receiver_types()— 1 callers, 6 callees
Verification — 2159 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 2116 function(s) in the blast radius were not formally verified this run