Closed InvisibleSmiley closed 2 years ago
First of all thanks for this, looks very promising. :-)
It seems that currently only \Laminas\ServiceManager\ServiceLocatorInterface is supported for get() and has().
\Laminas\ServiceManager\ServiceLocatorInterface
I'd love to see support for other common container interfaces, too, especially \Psr\Container\ContainerInterface.
\Psr\Container\ContainerInterface
Looking at the source code I'm a little confused because it seems to be supported in one place but not the other:
ServiceManagerLoader::$serviceManagerNames
\LaminasPhpStan\Rules\Laminas\ServiceManagerGetMethodCallRule::processNode
Can you add such support please (configurable if need be)?
Hi, can you create a PR for this please?
I'll see what I can do (for the non-configurable, always-active variant).
First of all thanks for this, looks very promising. :-)
It seems that currently only
\Laminas\ServiceManager\ServiceLocatorInterface
is supported for get() and has().I'd love to see support for other common container interfaces, too, especially
\Psr\Container\ContainerInterface
.Looking at the source code I'm a little confused because it seems to be supported in one place but not the other:
ServiceManagerLoader::$serviceManagerNames
lists both InteropContainerInterface and PsrContainerInterface\LaminasPhpStan\Rules\Laminas\ServiceManagerGetMethodCallRule::processNode
only handles ServiceLocatorInterface (isInstanceOf call)Can you add such support please (configurable if need be)?