phpstan-doctrine icon indicating copy to clipboard operation
phpstan-doctrine copied to clipboard

EntityNotFinalRule should also check for methods.

Open VincentLanglet opened this issue 3 years ago • 0 comments

We recently encountered a bug in SonataMediaBundle because setter/getter of entities were final. https://github.com/sonata-project/SonataMediaBundle/pull/2264

The doctrine doc say https://www.doctrine-project.org/projects/doctrine-orm/en/2.9/reference/architecture.html#entities

An entity class must not be final or contain final methods.

So, I think the EntityNotFinalRule should also check for final methods.

VincentLanglet avatar Jan 19 '22 14:01 VincentLanglet