phpstan-drupal
phpstan-drupal copied to clipboard
Check service name provided for argument to service
We cannot analyze services.yml provided by modules. PHPStan can only determine if a service uses a deprecated interface in its constructor or fetches deprecated services via a container injection method to construct itself.
HOWEVER. We can write a rule that checks the __construct method and checks if the current class is registered as a service. We can then inspect the arguments and check if any of them are deprecated.