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

SlevomatCodingStandard.Classes.RequireAbstractOrFinal should exclude classes with @final annotation #1669

Open
asispts opened this issue Mar 18, 2024 · 0 comments

Comments

@asispts
Copy link
Contributor

asispts commented Mar 18, 2024

I often exclude src/Entity from this sniff due to Doctrine entities being non-final classes. However, adding @final annotation to these classes and including checkTooWideReturnTypesInProtectedAndPublicMethods in PHPStan config allows us to detect mismatched return types in the class.

It would be beneficial to modify this sniff to enforce classes to either have abstract or final keywords or be annotated with @final.

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

No branches or pull requests

2 participants