Skip to content

[perf] Read attribute-class from node attrGroups in RemoveEmptyClassMethodRector - #8705

Merged
TomasVotruba merged 1 commit into
mainfrom
node-attribute-class-remove-empty-method
Oct 19, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
node-attribute-class-remove-empty-method

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

The constructor marker skip in RemoveEmptyClassMethodRector read isAttributeClass() from the class reflection fetched off the scope.

The rule already refactors the Class_ node directly, so the #[Attribute] marker can be read straight from $class->attrGroups. This drops the ClassReflection dependency and the extra getClassReflection() fetch for that check. Attribute-ness is never inherited, so the node check is equivalent.

Behavior unchanged - all 33 fixtures pass.

@TomasVotruba
TomasVotruba merged commit 3363fa2 into main Oct 19, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the node-attribute-class-remove-empty-method branch October 19, 2026 08:32
@TomasVotruba TomasVotruba changed the title Read attribute-class from node attrGroups in RemoveEmptyClassMethodRector [perf] Read attribute-class from node attrGroups in RemoveEmptyClassMethodRector Oct 19, 2026
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