Skip to content

function wp_remote_retrieve_header expects array|WP_Error, httpReturnType given. #150

@MocioF

Description

@MocioF

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 says
Parameter #1 $response of function wp_remote_retrieve_header expects array|WP_Error, httpReturnType given.

Why httpReturnType is not seen as an array?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions