Skip to content

Read class-like short names through ClassNameImportContext in ClassLikeName skip voter - #8695

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-context-classlike
Oct 17, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-context-classlike

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

What

ClassLikeNameClassNameImportSkipVoter depended on ShortNameResolver directly. It now reads the declared class-like short names through the shared ClassNameImportContext, continuing the consolidation from #8687 and #8691.

Change

  • ClassNameImportContext gains resolveShortClassLikeNames(File), delegating to ShortNameResolver::resolveShortClassLikeNames() (already version-cached).
  • The voter injects the context instead of ShortNameResolver; its namespace/scope comparison and NamespaceBeforeClassNameResolver usage are unchanged.

Pure consolidation - no behavior change, performance unchanged. Three of the five file-scanning voters now read from one place.

Tests

148 import tests green (rules-tests/CodingStyle/ClassNameImport, ImportFullyQualifiedNamesRector, tests/Issues/AutoImport*, NamespacedUseAutoImport, docblock import). ECS + full PHPStan clean.

@TomasVotruba
TomasVotruba marked this pull request as ready for review October 17, 2026 19:50
@TomasVotruba
TomasVotruba merged commit 1388310 into main Oct 17, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-context-classlike branch October 17, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant