Closed cmlara closed 1 year ago
I had originally though this was a phpstan-drupal issue due to an incorrect test case on the PHPStan playground, however after creating a more accurate test case I can see this is able to be duplicated without phpstan-drupal.
https://phpstan.org/r/287481fe-f00d-4b58-94a6-b70542131abf
I'm going to have to look into if this is a Drupal Core issue or a PHPStan issue however this issue can be closed.
I've encountered a minor issue with the container service resolution returning an incorrect interface when loading the keyvalue.expirable service through the container.
This can be duplicated using just core files with: phpstan analyze --level 3 web/core/lib/Drupal.php
380 Method Drupal::keyValueExpirable() should return Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface but returns Drupal\Core\KeyValueStore\KeyValueStoreInterface.
I've also duplicated this in a plugin implementing ContainerFactoryPluginInterface using
$container->get('keyvalue.expirable')->get('something')