phpstan-symfony
phpstan-symfony copied to clipboard
False positive with Symfony\Component\DependencyInjection\ContainerBuilder::has
I have around 10 compiler passes in my code base.
I have NOT configured the path to container XML as I am not interested in testing for existing/non-existing services.
However, somehow, one and only one of my compiler passes fails with the message:
Call to method Symfony\Component\DependencyInjection\ContainerBuilder::has()
with 'fos_http_cache.cache_manager' will always evaluate to false.
The code in question is fairly standard:
if (!$container->has('fos_http_cache.cache_manager')) {
return;
}
Every other compiler pass uses the same pattern and does not fail.
Why?
Thanks!
Same here:
Call to method Symfony\Component\DependencyInjection\ContainerBuilder::has() with 'sonata.doctrine…' will always evaluate to false.