Skip to content

[perf] Skip reflection in MakeInheritedMethodVisibilitySameAsParentRector when no parent or no methods - #8580

Merged
TomasVotruba merged 1 commit into
mainfrom
perf-make-inherited-visibility-cheap-guard
Oct 10, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
perf-make-inherited-visibility-cheap-guard

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Hoists two cheap, scope-free structural guards above resolveClassReflection():

  • $node->extends is not a Name - no parent class, so getParents() is empty and there is nothing to align to.
  • $node->getMethods() === [] - no methods to adjust.

Classes without a parent or without methods now bail out before touching class reflection. Same optimization shape as #8579.

@TomasVotruba
TomasVotruba merged commit ccb3f43 into main Oct 10, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the perf-make-inherited-visibility-cheap-guard branch October 10, 2026 09:06
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