Skip to content

PHP member calls tracer bullet: $this->prop->method() resolves to an INFERRED calls edge #2

Closed

Description

@filipechagas

Parent

Spec: #1 (upstream: Graphify-Labs#1682)

What to build

A Laravel-style controller that receives a service through a constructor-promoted property (or a typed property) and calls $this->service->method() gets a calls edge from the calling method to the service's method, labelled INFERRED. Nullsafe calls (?->) behave the same. Static Class::method() edges and same-file $this->method() edges keep working exactly as today.

This is the tracer bullet: it cuts the complete path — receiver capture in the PHP extraction walk, the per-class property→type table, receiver-type stamping on raw calls, and the new PHP member-call resolver registered in the language-resolver registry — for the narrowest receiver family (this / this.<prop>).

Receiver-key mapping (from AST probes; later tickets extend it):

Source form Receiver key
$this->m() this
$this->prop->m() this.prop
anything else none — behavior unchanged (this ticket)

Decisions that bind this ticket (see spec #1 for rationale):

  • Concrete-type policy: single named class type only; nullable unwraps; union, intersection, primitive, self, static, parent, and docblock-only types are refused.
  • The in-file bare-name match is skipped only when a receiver type was actually stamped — untyped receivers keep today's same-file edges.
  • Resolver guards (Java-resolver clone): exactly one type definition in the corpus and exactly one matching method, case-insensitive, no bare-name fallback; receiver this resolves against the enclosing class.
  • PHP raw calls carry a language tag (ticket on cross-resolver hardening builds on this).

Acceptance criteria

  • Constructor-promoted typed property: $this->prop->method() yields an INFERRED calls edge to the right method; a decoy class with an identically named method gets no edge
  • Non-promoted typed property yields the same
  • Nullsafe $this->prop?->method() yields the same
  • Untyped and union-typed properties yield no edge
  • Two same-named classes in the corpus yield no edge
  • Unknown method on the resolved class yields no edge and no fallback edge
  • Same-file $this->method() calls still produce edges as today (existing PHP language tests pass unchanged)
  • Static-call edges unchanged (existing PHP suites pass)
  • All tests go through the public extraction pipeline seam, mirroring the Java member-call test structure

Blocked by

None — can start immediately.

Activity

  1. added
    ready-for-agent
    on Aug 5, 2026
  2. filipechagas commented on Aug 5, 2026

    @filipechagas
    CollaboratorAuthor

    Implemented in 43cd7a2. Orchestrator gate: full suite 3947/36 (baseline + 14 extract()-seam tests), live repro shows the INFERRED constructor-injection edge with the static control unchanged. Accepted deviation: defer only when a receiver type was stamped, preserving untyped same-file edges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions