phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

Check service name provided for argument to service

Open mglaman opened this issue 4 years ago • 0 comments

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.

mglaman avatar Nov 30 '21 19:11 mglaman