diff --git a/graphify/extractors/engine.py b/graphify/extractors/engine.py index dc841cd87..6fb2616b9 100644 --- a/graphify/extractors/engine.py +++ b/graphify/extractors/engine.py @@ -7689,6 +7689,7 @@ def _extract_generic( # self): kept apart from member_receiver, which feeds the # receiver-typed resolvers and raw_calls. self_receiver: str | None = None + is_scoped_call: bool = False swift_receiver: str | None = None member_receiver: str | None = None kotlin_qualified_prefix: str | None = None @@ -8014,6 +8015,7 @@ def _extract_generic( # qualified-call branch here, so a dedicated PHP resolver can # bind it to the actual method on that class. is_member_call = True + is_scoped_call = True name_node = node.child_by_field_name("name") if name_node: callee_name = _read_text(name_node, source) @@ -8264,7 +8266,7 @@ def _extract_generic( and is_member_call and not lua_self_qualified ) - if _python_defer or _java_defer or (_builtin_member_call and not php_builtin_self_call) or _lua_member_defer or ( + if _python_defer or _java_defer or (_builtin_member_call and not php_builtin_self_call) or _lua_member_defer or is_scoped_call or ( is_member_call and member_receiver and ( diff --git a/tests/test_php_static_call_resolution.py b/tests/test_php_static_call_resolution.py index c97cfcba5..0f49bc5d8 100644 --- a/tests/test_php_static_call_resolution.py +++ b/tests/test_php_static_call_resolution.py @@ -48,16 +48,40 @@ def test_same_namespace_static_call_is_extracted_not_inferred(tmp_path): def test_self_and_static_scope_resolve_to_enclosing_class(tmp_path): - calls, _ = _extract(tmp_path, {"Widget.php": ( - "