Open mglaman opened 11 months ago
Actually, this wasn't a consequence of #610; it's been a latent problem for a while
if ($methodReflection->getName() === 'has') {
return new ConstantBooleanType($this->serviceMap->getService($serviceId) instanceof DrupalServiceDefinition);
}
I think this should be a new bleeding edge toggle to:
core.services.yml
, be concrete with the result.null
return typeget
after has
, do not consider it to be nullable (maybe if possible?)
Feature request
Consequence of https://github.com/mglaman/phpstan-drupal/pull/610/
This caused ContainerInterace::has to be "always true", which may lead developers to removing
if ($container->has()
checks, causing actual bugs. Especially around conditional dependencies.Slack thread for context: https://drupal.slack.com/archives/C033S2JUMLJ/p1701250878367139