Idea-php-symfony2-plugin: Mark indirectly used services as not unused

Created on 25 Jul 2019  路  6Comments  路  Source: Haehnchen/idea-php-symfony2-plugin

The new PhpStorm 2019.2 by default detects unused classes/methods.

Is it possible for your plugin to detect controllers and mark them as used?

Most helpful comment

I let PhpStorm locate all classes that are unused and this is what I found:

These are reported as unused even if you have compiled kernel inside project tree:

  • classes that are only used in annotations
  • doctrine migrations
  • controller methods

These are reported as unused if you have compiled kernel outside project tree:

  • commands
  • controllers
  • doctrine fixtures
  • listeners / subscribers
  • repositories (if you fetch them via entity manager and not directly as services)
  • authenticators
  • tagged services that you don't fetch directly
  • voters

This pretty much boils down to anything that is a service which isn't used directly.

All 6 comments

I let PhpStorm locate all classes that are unused and this is what I found:

These are reported as unused even if you have compiled kernel inside project tree:

  • classes that are only used in annotations
  • doctrine migrations
  • controller methods

These are reported as unused if you have compiled kernel outside project tree:

  • commands
  • controllers
  • doctrine fixtures
  • listeners / subscribers
  • repositories (if you fetch them via entity manager and not directly as services)
  • authenticators
  • tagged services that you don't fetch directly
  • voters

This pretty much boils down to anything that is a service which isn't used directly.

This seems a duplicate of #1366

@RikudouSage Please close in favor of #1366

@Jean85 @ruudk Isn't the other one duplicate of this, since this was first?

@RikudouSage You are right, but the other issue has more detailed information + reply from the maintainer. Just close this one and subscribe to the other one, it keeps the issue tracker a bit more organized 馃槉

Closed in favor of #1366

Was this page helpful?
0 / 5 - 0 ratings

Related issues

garak picture garak  路  6Comments

alexsakhnov picture alexsakhnov  路  7Comments

ostrolucky picture ostrolucky  路  4Comments

stof picture stof  路  6Comments

deivid11 picture deivid11  路  3Comments