Commit Graph
3 Commits
Author SHA1 Message Date
rikurunico 2d37da18c9 fix(php): resolve Class::method() static calls to the actual method
scoped_call_expression (`Helper::format()`) used the scope text as the
callee name instead of the method name, so the shared cross-file
bare-name pass bound the call to whatever node shared the class's
label - almost always the class definition - never the actual method.
It also skipped member-call handling entirely, so the edge went
through the import-evidence confidence gate: same-namespace PHP
classes never need a `use` import for each other, so every
same-namespace static call was stuck at INFERRED 0.85 even though the
receiver class is named explicitly in source.

Capture the real method name as the callee and the scope as the
receiver, mark it a member call, and add a dedicated PHP resolver
(mirroring the existing Java/Swift/C++ member-call resolvers) that
binds self::/static:: to the enclosing class, parent:: through a
single inherits edge, and Class:: to the class's own method - all
EXTRACTED, since the receiver is named explicitly in source. A
dynamic scope ($var::method()) has no declared-type table to resolve
against and is left unresolved rather than guessed.

Fixes #3872

(cherry picked from commit 2ec460168b)
2026-10-12 14:49:34 +01:00
safishamsi 8906834ff0 test(php): escape namespace backslashes in object-creation fixtures (#3115)
The fixtures embedded PHP namespace paths (\App\Bar, App\Command) as plain strings, so
\A / \C were invalid escape sequences (SyntaxWarning now, SyntaxError in a future Python).
Double the namespace backslashes; the \n newlines are unchanged.
2026-08-29 16:15:58 +01:00
abhay-codes07 f57af70f77 fix(php): emit a calls edge for object creation, new Foo(...) (#3115)
A PHP `new Foo()` emitted no edge. Add object_creation_expression to the PHP call types and
emit a calls edge to the constructed class (namespaced names resolve to the last segment),
consistent with the C# (#2998) and TypeScript (#3135) object-creation handling. Dynamic
(new $var()), self/static/parent, and unknown external constructions fabricate nothing.
2026-08-29 16:15:01 +01:00