Repository navigation
Read short-names map through ClassNameImportContext in FullyQualifiedName skip voter - #8691
Merged
Merged
Conversation
TomasVotruba
force-pushed
the
tv-import-context-shortnames
branch
from
October 17, 2026 19:46
f6fc1c9 to
8c0d2ca
Compare
TomasVotruba
marked this pull request as ready for review
October 17, 2026 19:46
This was referenced Oct 17, 2026
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.
What
FullyQualifiedNameClassNameImportSkipVoterdepended onShortNameResolverdirectly. It now reads the short-name-to-FQN map through the sharedClassNameImportContext, matching howAliasClassNameImportSkipVoterandUsesClassNameImportSkipVoteralready consume file-global import facts (#8687).Change
ClassNameImportContextgainsresolveShortNamesToFullyQualifiedNames(File), delegating toShortNameResolver::resolveFromFile().ShortNameResolver.Pure consolidation step - no behavior change.
ShortNameResolver::resolveFromFile()keeps its own caching, so performance is unchanged; the win is that voters now read from one place, setting up later collapse of the voter services behind the context.Follow-up noted
ShortNameResolver::resolveFromFile()caches by file path only and never invalidates across stmts versions. Left as-is here to keep this step behavior-neutral; worth a dedicated version-keyed fix (moving that cache into the context) in a later step.Tests
153 import tests green (
rules-tests/CodingStyle/ClassNameImport,ImportFullyQualifiedNamesRector,tests/Issues/AutoImport*,NamespacedUseAutoImport, docblock import). ECS clean. PHPStan clean on changed files (the 2 unrelatedshipmonk.deadMethodhits on main are from #8690's deprecated VO, not this PR).