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.
124 stars 6 forks source link

Detect `Symfony\Component\HttpKernel\Controller\ValueResolverInterface` as entry point #85

Open ruudk opened 2 months ago

ruudk commented 2 months ago

It should not complain about the constructor.

janedbal commented 2 months ago

How did you register such resolver? I thought you need to have it in DIC (which is detected):

services:
  ShipMonk\InputMapper\InputArgumentValueResolver:
    tags:
      -
        name: controller.argument_value_resolver
ruudk commented 2 months ago

We're using Autowire and don't have an XML file for the container. See https://github.com/shipmonk-rnd/dead-code-detector/issues/92 for an explanation.

janedbal commented 2 months ago

To induce that constructor is used once #[Autowire] is used, we probably also need something like this.