Skip to content

PHP: interface-typed receivers refuse, even under short-name collision #5

Closed

Description

@filipechagas

Parent

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

What to build

A receiver whose declared type is a PHP interface never produces a calls edge — even when a single unrelated class in the corpus shares the interface's short name (Laravel's Contracts convention makes this collision realistic). The extractor pre-scans interface declarations (following the existing C# interface pre-scan pattern) and the resolver refuses any receiver type matching a known interface name. Implementations are never guessed.

Acceptance criteria

  • Interface-typed property receiver: no calls edge to the interface's implementation
  • Interface + same-short-named unrelated class in the corpus: no edge into that class
  • Interface refusal is case-insensitive, matching PHP name semantics
  • Existing PHP type-resolution tests pass unchanged

Blocked by

Activity

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

    @filipechagas
    CollaboratorAuthor

    Implemented in 4f17dd8. Orchestrator gate: full suite 3982/36 (+7 tests). Interface pre-scan at extraction (C# pattern), resolver refuses receiver types matching known interface names case-insensitively, across all three receiver entry points (typed property, typed param, inline-new). Two items handed to #7: (1) measured hole — interface refusal does not survive incremental rebuilds (interface names have no channel into the persisted resolution context; repro at /tmp/probe_php_iface_incremental.py); (2) changelog line — interface Foo + unrelated class Foo means calls through the class are also refused (conservative).

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