Skip to content

ExpressionResolver::resolveMember iterates every receiver class - #485

Merged
Firehed merged 6 commits into
mainfrom
step/27
Sep 2, 2026
Merged

ExpressionResolver::resolveMember iterates every receiver class#485
Firehed merged 6 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 (dfa0b95).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #485   +/-   ##
=========================================
  Coverage     99.39%   99.39%           
- Complexity     1857     1864    +7     
=========================================
  Files           133      133           
  Lines          4780     4785    +5     
=========================================
+ Hits           4751     4756    +5     
  Misses           29       29           

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

Firehed and others added 4 commits September 2, 2026 09:08
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Firehed
Firehed marked this pull request as ready for review September 2, 2026 19:10
@Firehed
Firehed merged commit 01bc5be into main Sep 2, 2026
9 checks passed
@Firehed
Firehed deleted the step/27 branch September 2, 2026 19:46
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