Skip to content

[TypeDeclaration] Speed up AddReturnTypeDeclarationRector by resolving class reflection only for static return type - #8658

Open
TomasVotruba wants to merge 1 commit into
mainfrom
tv-perf-add-return-type-static-reflection
Open

TomasVotruba wants to merge 1 commit into
mainfrom
tv-perf-add-return-type-static-reflection

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Performance refactor of AddReturnTypeDeclarationRector. No behavior change - all 9 fixtures pass unchanged.

resolveClassReflection() was called on every configured return-type change, but its result is used only when the new type is a SimpleStaticType (to rebuild it as a StaticType). The reflection resolution is now moved inside that branch, so the common configured cases (plain object/scalar/array return types) no longer pay for it.

…g class reflection only for static return type
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