PHP: inter-class member calls are silently dropped, and language builtins (e.g. `empty()`) get mis-wired to same-name internal methods
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start in extract.py by comparing existing member-call resolvers with the missing PHP path, then inspect _park_unresolved_member_call and _rewire_unique_stub_nodes. Reproduce both missing member edges and builtin mis-wiring using the described PHP corpus, and verify that real calls are resolved or parked while builtin names are not rebound in graph.json.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
- graphify 0.9.65 (also reviewed 0.9.66/0.9.67 release notes — no PHP member-call resolver mentioned)
- Corpus: a ~52 MB Symfony PHP bundle (11,007 nodes / 32,817 edges after extraction),
--code-onlymode
Problem A — PHP member calls are silently dropped
extract.py ships member-call resolvers for Swift, Python, TypeScript, C++, C#, Java… but there is no _resolve_php_member_calls. A PHP call like:
$this->emailSender->prepareAndSendEmail($action);
produces no edge at all. Empirical check on our graph: EmailSender::prepareAndSendEmail has 0 incoming edges from other files while at least two services call it — all 18 of its incoming calls edges are intra-file self-calls.
Notably, the cross-repo parking mechanism already exists (_park_unresolved_member_call -> metadata.unresolved_calls, ref #3152) but is never invoked for PHP. Our full graph contains zero parked entries with "lang": "php" — the calls are dropped with no trace instead of being parked.
Problem B — builtins get mis-wired to same-name internal methods
_rewire_unique_stub_nodes rebinds a call to the single internal method sharing the callee's name. PHP language builtins collide with that rule:
- ~200 calls to
empty()(language construct) across ~150 files are wired to an internal methodParseCollectionPaginator::empty()— including 24 false edges from two god-node services alone. - Same risk class for common names:
execute,handle,format.
So the graph is wrong in both directions: missing edges on real inter-class calls, polluted edges on builtin names.
Impact on a real corpus
A local post-processor (tree-sitter-php, same parking format) recovered on this single bundle:
- -454 false edges removed (builtin rewiring)
- +1,566 real edges added (typed-property member calls, interface -> implementations)
- 6,558 calls parked in
metadata.unresolved_calls(previously dropped silently)
Suggested fix
- Add a PHP member-call resolver: receiver type from typed/promoted constructor properties +
$this->method()self-calls; interface calls -> all implementations. - Park unresolved PHP member calls in
metadata.unresolved_calls(same payload format as other languages,"lang": "php") somerge-graphscan finish the edges. - Never rewire a builtin callee name (
empty,count,strlen, ...) to an internal method — consult a builtin list per language before rewiring.
Repro
Any PHP corpus containing $this->someTypedProperty->method(): the edge is absent from graph.json and nothing appears in metadata.unresolved_calls for the caller. Then add a second method named empty anywhere in the corpus and observe empty() calls being wired to it.
Happy to share our local post-processor (pure post-processing on graph.json, idempotent) if useful as a reference implementation.
- Lingua principale
- Python
- Stelle
- 124k
- Fork
- 11.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Graphify-Labs/graphify
-
test(elixir): add a defguardp regression testForse già presa @ClockZW l’ha presa 1 giorno fa. Apertagood first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Graphify-Labs/graphify#4076 ·
I maintainer di solito rispondono entro 1 giorno
-
test(php): parametrize the language-construct test across all constructsForse già presa @xiehuanyi l’ha presa oggi. Apertagood first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Graphify-Labs/graphify#4075 ·
I maintainer di solito rispondono entro 1 giorno
-
test(zig): assert a tagged-union nested-struct payload's fields are not mintedForse già presa @Jarvis-J-Jacob l’ha presa 1 giorno fa. Apertagood first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Graphify-Labs/graphify#4074 ·
I maintainer di solito rispondono entro 1 giorno
-
test(rust): positive same-family cross-language base resolutionForse già presa @xiehuanyi l’ha presa 1 giorno fa. Apertagood first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Graphify-Labs/graphify#4073 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(astro): port the U+2028 trailing-comment terminator from the Svelte maskerForse già presa @Sourya-Prabaharan l’ha presa 1 giorno fa. Apertagood first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Graphify-Labs/graphify#4072 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Graphify-Labs/graphify
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
modelcontextprotocol/python-sdk#3648 ·
I maintainer di solito rispondono entro 1 giorno
-
docs good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
VenetoStato/giorgio#6 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Claiming namespace ddalusAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
EclipseFdn/open-vsx.org#13831 ·
I maintainer di solito rispondono entro 1 giorno