Closed MocioF closed 6 months ago
Hello @MocioF!
Thank you for your report.
There is no httpReturnType
type. That variable holds an array shape.
Please write that array shape into your method.
https://github.com/php-stubs/wordpress-stubs/blob/5b0b62320bf41013db4cea68426ab2b959abaa28/functionMap.php#L5
Thanks @szepeviktor , this is what I'm doing now.
Not sure if this can help, but now PHPStan says: Class WP_Http_Cookie referenced with incorrect case: WP_HTTP_Cookie
.
Class WP_Http_Cookie referenced with incorrect case: WP_HTTP_Cookie
.
That is an error.
Would you like to send a PR?
Hi, I'm using wordpress-stubs with PHPStan for a plugin. One of my methods returns the result of
wp_remote_get()
so I wrote in its phpdoc's comment:@return httpReturnType|WP_Error
Now when I use the returned value in another method calling
wp_remote_retrieve_header
PHPStan saysParameter #1 $response of function wp_remote_retrieve_header expects array|WP_Error, httpReturnType given.
Why httpReturnType is not seen as an array?