Skip to content

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Nov 3, 2023

No description provided.

@dbu
Copy link
Contributor Author

dbu commented Nov 3, 2023

@Ndiritu could you help me here please to figure out what annotations we need to put to avoid the phpstan errors after php-http/promise#27?

@Ndiritu
Copy link

Ndiritu commented Nov 3, 2023

Sure

@Ndiritu could you help me here please to figure out what annotations we need to put to avoid the phpstan errors after php-http/promise#27?

Sure, taking a look @dbu

@ste93cry
Copy link

ste93cry commented Nov 6, 2023

I've been hit in one of the projects I contribute to by PHPStan complaining that

Method handleRequest() has parameter [...] with generic interface Http\Promise\Promise but does not specify its types: T

This has happened indirectly because the project implements a custom plugin. Since such method is expected to return a ResponseInterface, the solution that seems to work is the following:

/** - * @param callable(RequestInterface): Promise $next + * @param callable(RequestInterface): Promise<ResponseInterface> $next - * @param callable(RequestInterface): Promise $first + * @param callable(RequestInterface): Promise<ResponseInterface> $first * - * @return Promise + * @return Promise<ResponseInterface> */
@dbu
Copy link
Contributor Author

dbu commented Nov 22, 2023

@ste93cry we try to fix just the phpstan issue in #234 but seem to have a problem with phpstan (or some confusion on how to correctly annotate)

@dbu dbu force-pushed the fix-static-ci branch 3 times, most recently from ef61211 to ee440ee Compare January 4, 2024 19:04
@dbu dbu merged commit 74da2cd into 2.x Jan 4, 2024
@dbu dbu deleted the fix-static-ci branch January 4, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants