Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Php83] Remove get traits class as ancestors collection on AddOverrideAttributeToOverriddenMethodsRector #6513

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Nov 26, 2024

continue of PR:

since we skip override only trait anyway, we can just remove it from ancestors collection, so only parent classes.

-$parentClassReflections = array_merge($classReflection->getParents(), $classReflection->getTraits());
+$parentClassReflections = $classReflection->getParents();

as add #[\Override] on non-empty trait is not-allowed, which must rely on parent class method which not empty first to allow add it.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 4e03157 into main Nov 26, 2024
36 checks passed
@samsonasik samsonasik deleted the remove-trait branch November 26, 2024 06:06
@TomasVotruba
Copy link
Member

Awesome 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants