-
I am doing:
Which gives the static analysis error:
So I tried to make it happy with:
But now it says:
Does anyone know the proper way to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
/** @var QueryAdapter<mixed> **/
$adapter = new QueryAdapter($queryBuilder); That should be the minimum OK annotation to provide a generic type. If your SA is groaning about the use of mixed, then change it to whatever result type your query is providing (I'm assuming this would be a mapped document in the ODM, so say you're querying the list of users, that would be |
Beta Was this translation helpful? Give feedback.
-
Brilliant, thanks for the speedy reply.
However
I can go with |
Beta Was this translation helpful? Give feedback.
Okay, might have found the answer, Psalm doesn't like templates being used in static functions: vimeo/psalm#7507 (comment)
So should be able to fix it with something like:
If it's okay I created a pull request: Ba…