Skip to content

[TypeDeclaration] Retarget ReturnTypeFromMockObjectRector to Class_ node - #8830

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-retarget-mockobject-class
Oct 25, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-retarget-mockobject-class

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Retargets ReturnTypeFromMockObjectRector from ClassMethod to Class_ node, matching the ongoing retarget campaign (#8824, #8827).

The rule now subscribes to Class_, resolves the class reflection once via getClassReflection(), bails early if the class is not a PHPUnit test case, then loops over methods. This avoids a per-method scope/reflection lookup to decide the test-case guard.

Behaviour is unchanged - same guards, same resulting MockObject return type. Tests moved to the Class_ namespace accordingly.

@TomasVotruba
TomasVotruba merged commit 9e10367 into main Oct 25, 2026
48 of 49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-retarget-mockobject-class branch October 25, 2026 20:27
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