The project I’m working on has right now 7710 services. Autowiring is enabled and paths were not always excluded from autowiring, so right now we have a lot of services, which I’m sure, are not used as a service.
The big problem with that is the container build time.
Is there a way to find out unused services?
Symfony 4.3/PHP 7.4
P.S.:
I already started with a small php script to read the container xml. Perhaps some can point me to the right direction: https://gist.github.com/dr0bz/0fd18255f5a5c3b6b17ab3e8152be225. It finds a lot of false positives. Although it helped to get rid of about 400 services right now.