Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add generics to cache item #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ossinkine wants to merge 1 commit into phpstan:1.2.x from ossinkine:cache-item-generic

Conversation

Copy link
Contributor

@ossinkine ossinkine commented Jul 10, 2022

Add type of cached items to improve type checking

Copy link
Contributor

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

Copy link
Contributor

stof commented Mar 24, 2025

As this is about adding generic types for the PSR Cache interface, which is not specific to Symfony, I'm not sure this should be done by the phpstan-symfony extension (and this should probably be discussed with FIG first to try to get them upstream)

VincentLanglet reacted with thumbs up emoji

Copy link
Member

Agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /