coding-standard
coding-standard copied to clipboard
`SlevomatCodingStandard.Classes.RequireAbstractOrFinal` should exclude classes with `@final` annotation
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.