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

Add generics to cache item

Open ossinkine opened this issue 2 years ago • 1 comments

Add type of cached items to improve type checking

ossinkine avatar Jul 10 '22 18:07 ossinkine

Hi @ossinkine, adding generics with a phpstan stub is always tricky, because if someone use both psalm and phpstan writes CacheItemInterface<Foo> psalm will report an error because it's not a generic.

Best would be to do the PR directly on php-fig/cache and symfony/symfony repository. (Symfony now accepts to add generics)

Or at least to provide the same PR on psalm-plugin https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs/common/Contracts/Cache

VincentLanglet avatar Aug 28 '22 14:08 VincentLanglet