Skip to content

🪧 Generics, covariance, and @method #10895

Closed Answered by ondrejmirtes
arnapou asked this question in Support
Discussion options

You must be logged in to vote

Generics provide a way how to solve this parameter contravariance problem. It's described here: https://phpstan.org/blog/generics-in-php-using-phpdocs#these-rules-are-useful%2C-but-sometimes-limiting

In your case it'd look like this: https://phpstan.org/r/ae194a3c-529c-44f5-a0bc-566af710a14d

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@arnapou
Comment options

Answer selected by arnapou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants