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

Service resolution returns incorrect interface for keyvalue.expirable

Open cmlara opened this issue 3 years ago • 0 comments

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')

cmlara avatar Apr 20 '22 08:04 cmlara