Skip to content

[TypeDeclaration] Retarget ClosureReturnTypeFromAssertInstanceOfRector to Class_ node - #8842

Closed
TomasVotruba wants to merge 1 commit into
mainfrom
tv-retarget-closure-assert-instanceof-class
Closed

TomasVotruba wants to merge 1 commit into
mainfrom
tv-retarget-closure-assert-instanceof-class

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Retargets ClosureReturnTypeFromAssertInstanceOfRector from the Closure node to the Class_ node.

The rule only applies inside PHPUnit test case classes. Targeting Class_ lets it resolve the class reflection via fetchClassLikeReflection() instead of $scope->getClassReflection(), then iterates the closures within the class. This drops the per-closure scope fetch and the forbidden scope-reflection lookup.

Behavior is unchanged - existing fixtures pass.

@TomasVotruba
TomasVotruba deleted the tv-retarget-closure-assert-instanceof-class branch October 26, 2026 08:12
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