dead-code-detector icon indicating copy to clipboard operation
dead-code-detector copied to clipboard

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

Open ruudk opened this issue 1 year ago • 4 comments

It should not complain about the constructor.

ruudk avatar Sep 14 '24 07:09 ruudk

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

janedbal avatar Sep 14 '24 11:09 janedbal

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.

ruudk avatar Sep 14 '24 14:09 ruudk

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

janedbal avatar Sep 14 '24 15:09 janedbal

This is now possible to do via AST-based extension point: MemberUsageProvider::getUsages(): list<ClassMemberUsage> (since 0.7.0)

janedbal avatar Dec 23 '24 12:12 janedbal