Skip to content

[RFC] Report error for non final class without children #262

@VincentLanglet

Description

@VincentLanglet

Psalm just created a ClassMustBeFinal error with some explanation:

  • Harder BC-policy
  • Final classes are optimized by PHP/Opcache

vimeo/psalm#11279

I was wondering if the same report would be

  • easy to implement for phpstan
  • a good idea for phpstan-strict-rule

It will report an error if

  • The class is not final
  • The class has no children
  • The class does not have @final annotation
  • The class does not have @api annotation
  • Something else ?

Also, best would be for phpstan-doctrine plugin to automatically ignore this rule for the src/Entity folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions