Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #478 +/- ##
============================================
- Coverage 99.40% 99.35% -0.05%
+ Complexity 1875 1873 -2
============================================
Files 132 132
Lines 4838 4805 -33
============================================
- Hits 4809 4774 -35
- Misses 29 31 +2 ☔ View full report in Codecov by Harness. |
Route the docblock and constructor lookups through resolveMember so the two private find* finders in ExpressionResolver are the sole direct callers of MemberResolver::findMethod/findProperty, then add a disallowedMethodCalls entry that locks that boundary in. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Firehed
marked this pull request as ready for review
September 1, 2026 18:48
Owner
Author
|
All changed lines covered, project coverage drop not relevant. |
Firehed
added a commit
that referenced
this pull request
Sep 1, 2026
Follow-up to #473. Scope grew after a second scan surfaced five more M×N patterns not captured by the current manifest, and after the realisation that step-21's baseline hard-lock made new tighten rules impractical. ## Tightens to steps 25 and 26 - **step-25** — enumerates the nine node kinds that must gain docblock coverage; notes that if `docblockForExpression` becomes a one-liner it is deleted and inlined rather than kept as a wrapper. - **step-26** — names `Domain\LateBindingKeyword` as the sole home (drops the "or `ScopeFinder::resolveClassName`, whichever" hedge); adds a `tests/Architecture/` test that fails if the three keyword literals appear in `src/` outside the enum. ## New steps 27-31 for uncaptured M×N findings Each ships a `disallowedMethodCalls` tighten modelled on #478's pattern. - **step-27** — union/intersection receivers: every member-lookup site in `ExpressionResolver` and `MemberAccessDetector` picks `getResolvableClassNames()[0]` while `SymbolResolver::getAccessibleMembers` iterates. Failure: `function f(A|B $x) { $x->onlyB(); }` — completion offers `onlyB`, hover returns null. Tighten pins `getResolvableClassNames()` to the shared helper. - **step-28** — `resolveConstFetch` uses one lookup, `resolveFuncCall` iterates `NameContext::candidates`. Failure: `namespace App; const X = 1; echo X;` — hover on `X` returns null. Tighten pins `SymbolSource::lookupConstant` to `ExpressionResolver`. - **step-29** — `SymbolCandidates` reads `->docblock` + `DocblockParser::extractDescription` directly, bypassing `HasSymbolLocation::getDocumentation()`. Preventive today; a future tag-strip in `getDocumentation()` would silently miss completion detail. Tighten pins `DocblockParser::extractDescription` to `HasSymbolLocation`. - **step-30** — `HoverHandler`, `SignatureHelpHandler`, and `CompletionItemFactory` each compose `format()` + `getDocumentation()` themselves; a `ResolvedSymbolPresenter` consolidates the shape. Tighten pins the two methods to the presenter. - **step-31** — `$this` typing has an AST path in `ExpressionResolver` and a text-fallback side-channel in `MemberAccessDetector` (via a `resolvedType` node attribute). Deletes the attribute; routes both through one helper. Tighten pins `TextFallbackHelper::resolveEnclosingClassName` to that helper. ## Relaxes bin/check-baseline-shrink NOW Step-21's script failed if either baseline file existed. That made new tighten rules with residuals impossible to add. Restored the pre-step-21 shrink-only-when-present logic (comparing to `origin/main`). The hard "must-not-exist" lock moves to the retire step, by which point every interim tighten will have drained its residual. ## Beefed-up retire (step-32) - Restores the hard lock on `bin/check-baseline-shrink`. - Adds a `tests/Architecture/HandlerDependenciesRule.php` that fails if any handler in `src/Handler/` names `ParserService`, `SymbolIndex`, `MemberResolver`, or `SymbolSource` directly — code-enforcing the "handlers are formatters, not resolvers" invariant that CLAUDE.md documents but nothing enforces today. - Updates `CLAUDE.md` Guardrails and Architecture Invariants to reflect final state: baselines permanently gone, freeze paragraph deleted, the running list of scoped `disallowedMethodCalls` tightens named as the seams they pin. ## Considered and dropped from the scan - Two regex classifiers for call kind (`TextFallbackHelper::parseCallPattern` vs `CompletionClassifier`) — verifier confirmed they answer different questions on the same input; no feature asymmetry possible. - Two text regex walkers (`DefaultTextSymbolExtractor` vs `TextFallbackHelper::findClassLikeDeclarations`) — `DefaultTextSymbolExtractor` is a consumer of the second; already unified. _PR body written by AI, reviewed by a human._
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retargets step-24 to the structural M×N only — the "late-binding on properties as it does for methods" clause was unsatisfiable (PHP forbids
staticas a property type), so the row now covers the four near-identical resolvers only.Done
ExpressionResolver::resolveMemberowns the receiver →ClassNamedance (NameviaScopeFinder::resolveClassNameInContext, expression viaresolve()->getType()->getResolvableClassNames()), and each caller passes a first-class kind-specific finder (findMethod(...)/findProperty(...)).resolveMembercall, and one smallfind*finder (or reuse of an existing one).composer testpasses locally.Tightening
Locked in the boundary the refactor establishes:
docblockForExpression's method/property branches andresolveConstructorthroughresolveMembertoo, so the file's two privatefind*finders are the sole direct callers ofMemberResolver::findMethod/findProperty.disallowedMethodCallsentry inphpstan.neonforMemberResolver::findMethod()andMemberResolver::findProperty(), allowed only insrc/Resolution/ExpressionResolver.php(plusMemberResolver.phpitself for its trait-alias self-calls, and tests). A future siblingresolve*that reaches forMemberResolver::findMethoddirectly instead of going throughresolveMembernow fails PHPStan.