Closed pa- closed 9 months ago
Got similar problem with other tools (deptrac) for tracking dependencies. Both use nikic/php-parser under the hood and check actual php imports. The solution might be to extend the dependency collector to scan .yaml .xml other codegen places
Thanks for feedback :+1:
We've added a white list of classes, that should be skipped to help with this use case.
If your Symfony/Doctrine/framework class is missing there, please add it so it's passing: https://github.com/TomasVotruba/class-leak/blob/ab39660d55919f1273d8f77aac64dea8588bd482/src/Filtering/PossiblyUnusedClassesFilter.php#L18
Hi Tomas,
thanks for this Tool! Maybe i am doing something wrong, but right now i am getting a lot of false positivs in a Symfony project.
For example:
1) Constraints/Validators Only the Contraint is used (e.q. in an Entity) and not the Validator itself.
From the docs:
So no direct use of the Validator
2) Tagged Iterator
I am using the tagged Iterator (https://symfony.com/doc/current/service_container/tags.html#reference-tagged-services). I tag all classes implementing some Interface and inject them into a Service. So there is no direct use of the class implementing the Interface
3) Mutations/Resolver in GraphQL
This is maybe not directly related to Symfony, but maybe you have some thoughts on how to handle this. im use the overblog/GraphQLBundle to handle GQL Request. If you are not familier with GQL i'll try to give you some quick introduction. You have an Query (or Mutation), which is defined in an yaml (see Example below). In this example: "adresseUsage". You can think of it as an "action" in a Symfony Controller. Every GQL Request send to a single REST Endpoint and internally handled by the configured Resolver ("AdresseResolver")
So, again no direct use of the Resolver itself :disappointed:
4) Messenges/MessageHandler Very similar to Constraints/Validator. You have same Messages dispatched through an MessageBus and the handled by a MessageHandler. The MessageHandlers are configured by an Attribute and Symfony will take care of everything.
Any toughts on how to solve these issues?
best regards!