shipmonk-rnd / dead-code-detector

💀 PHP unused code detection via PHPStan extension. Detects dead cycles, supports libs like Symfony, Doctrine, PHPUnit etc. Can automatically remove dead PHP code.
105 stars 6 forks source link

Detect `Doctrine\ORM\EntityRepository` as entry point #87

Closed ruudk closed 1 month ago

ruudk commented 1 month ago

It should not complain about the constructor.

janedbal commented 1 month ago

So, you are using $em->getRespository() approach? In such case, I'd expect no need for constructor declaration in children. In past (before we got rid of EntityRepository completely), we had all repositories registered as DIC services (which should be detected by dead-code-detector).

But I'm just curious, I'll add support for this, thanks.

ruudk commented 1 month ago

No, we're not using the $em->getRepository() approach but inject repositories as dependencies. But it's related to this: https://github.com/shipmonk-rnd/dead-code-detector/issues/92