-
-
Notifications
You must be signed in to change notification settings - Fork 151
Psalm TooManyTemplateParams error #401
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
Comments
@gdejong Thanks for reporting! The This was added a while ago, i.e. before PHPStan/Psalm started supporting the Nowadays, we should probably add a As an alternative, we may also change this annotation to only Does anybody feel like looking into this and filing a PR? |
@clue Question about this:
For reference, I am using https://github.com/Bocmah/psalm-reactphp-promise-plugin/blob/main/stubs/PromiseInterface.phpstub and have no problems with psalm on level 1 but there is just 1 templated param. Stub for await also gives me correct return type: /**
* @template TResolved
*
* @param PromiseInterface<TResolved> $promise
*
* @return TResolved
*/
function await(PromiseInterface $promise, LoopInterface $loop, $timeout = null){} |
Promise template types will be added in reactphp/promise#227 (and referenced tickets) soon, so I don't think there's much that needs to be done here. I'll close this ticket for now, but please report back if there's anything that is missing here. |
FYI the PR's to address this across our packages are listed here: reactphp/promise#223 (comment) |
Given:
and running Psalm on it with level 6 or lower, I get the following error:
I am not sure if this is the right place, but I was wondering if you could shed some light on this.
Perhaps Psalm doesn't like the
@return PromiseInterface<ResponseInterface>
type hint in\React\Http\Browser::get
?Maybe the questions should be, does this project aims to be compatible with Psalm?
The text was updated successfully, but these errors were encountered: