Skip to content

[dx] Add getClassReflection() to AbstractRector, use it in Class_ node rules - #8827

Merged
TomasVotruba merged 7 commits into
mainfrom
tv-get-class-reflection
Oct 25, 2026
Merged

TomasVotruba merged 7 commits into
mainfrom
tv-get-class-reflection

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Adds getClassReflection(ClassLike) helper to AbstractRector, resolving the class reflection by name via ReflectionProvider instead of fetching it off the scope.

Replaces the ScopeFetcher::fetch($node)->getClassReflection() pattern in rules that subscribe to Class_:

  • Php4ConstructorRector
  • PrivatizeFinalClassConstantRector
  • RemoveRefactorDuplicatedNodeInstanceCheckRector
  • ObjectTypedPropertyFromJMSSerializerAttributeTypeRector
  • ConvertStaticToSelfRector
  • RemoveUnusedPrivateClassConstantRector

@TomasVotruba TomasVotruba changed the title Add getClassReflection() to AbstractRector, use it in Class_ node rules [dx] Add getClassReflection() to AbstractRector, use it in Class_ node rules Oct 25, 2026
@TomasVotruba
TomasVotruba merged commit 016d7f2 into main Oct 25, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-get-class-reflection branch October 25, 2026 20:08
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.

2 participants