fix(php): preserve use-statement facts and stop group-form use function/const from claiming class names - #2502
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 reworks how PHP use statements are parsed during graph extraction. It introduces a shared use-statement parser (_php_use_clause_fact, _php_use_clause_context, _php_use_declaration_facts) in resolution.py and updates both _import_php (the imports edge capture) and _resolve_php_type_references to use it, so group-use syntax, aliases, absolute names, and function/const keyword placement are handled consistently. It also adds use_kind, alias, and target_fqn metadata to PHP imports edges, and adds a new test file plus CHANGELOG entries. The surface area spans graphify/extract.py, graphify/extractors/resolution.py, a new tests/test_php_group_use_kind.py, and CHANGELOG updates.
No blocking issues surfaced. 3 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1673 functions depend on the 511 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
extract()— 379 callers, 39 callees
Verification — 1673 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: 1543 function(s) in the blast radius were not formally verified this run