rector: [SOLID] Rector\SOLID\Rector\Class_\FinalizeClassesWithoutChildrenRector: should not change Doctrine Entities

When using the level solid, it will turn every non-final class to final, including Doctrine entities. But as stated in Doctrine’s documentation :

An entity is a lightweight, persistent domain object. An entity can be any regular PHP class observing the following restrictions: - An entity class must not be final or contain final methods.

So it would be nice if there was a way for Rector to detect @ORM\Entity annotation and not process these classes.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 18 (18 by maintainers)

Commits related to this issue

Most upvoted comments

I fixed it by running Rector from the root of the project (/app) instead of the root of the Docker container (/), see the 2nd point of my comment here