phpstan-doctrine
phpstan-doctrine copied to clipboard
EntityNotFinalRule should also check for methods.
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.