Skip to content

ExpressionResolver::resolveMember iterates every receiver class - #485

Draft
Firehed wants to merge 2 commits into
mainfrom
step/27
Draft

ExpressionResolver::resolveMember iterates every receiver class#485
Firehed wants to merge 2 commits into
mainfrom
step/27

Conversation

@Firehed

@Firehed Firehed commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Step 27 of docs/architecture/build-manifest.md.

Done

  • no callsite in src/Resolution/ indexes [0] on getResolvableClassNames() — verified by disallowedMethodCalls in phpstan.neon (allowlist restricted to ExpressionResolver::receiverClassNames and SymbolResolver::getAccessibleMembers, plus the two Domain/ recursive-composition sites)
  • hover, definition, and signature-help on \$x->onlyB() where \$x: A|B and only B declares onlyB answer the same way completion offers it — UnionReceiverParityTest
  • a parity test asserts the four positional handlers and completion agree on union and intersection receivers — UnionReceiverParityTest covers Hover, Definition, SignatureHelp, Completion against the Entity|Person fixture where each constituent declares a distinct member; intersection agreement is exercised by the existing SymbolResolverTest::testGetMemberAccessContextForIntersectionParameterResolvesType
  • the phpstan baseline for the rule reaches zero — the two step-27 entries in phpstan-baseline.neon are deleted; composer phpstan is clean

Firehed and others added 2 commits September 1, 2026 18:19
Union and intersection receivers previously lost members declared past
the first constituent because resolveMember indexed [0] on the receiver
type's resolvable classes. It now iterates every class and returns the
first find, mirroring SymbolResolver::getAccessibleMembers.

MemberAccessDetector's three [0] sites route through the same shared
helper (ExpressionResolver::receiverClassNames) and combine
per-constituent visibility, so a union receiver widens to the most
restrictive access across its members.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.39%. Comparing base (d2d0dda) to head (d048162).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #485   +/-   ##
=========================================
  Coverage     99.39%   99.39%           
- Complexity     1857     1863    +6     
=========================================
  Files           133      133           
  Lines          4780     4783    +3     
=========================================
+ Hits           4751     4754    +3     
  Misses           29       29           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant