Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Fix error reported by Psalm
Browse files Browse the repository at this point in the history
Explicitly declare var type. This is necessary likely because the documented return type of `wp_remote_request()` is not formatted correctly according to Psalm.
  • Loading branch information
XedinUnknown committed Aug 13, 2023
1 parent b75bf73 commit a1c41ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/WpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use RebelCode\Psr7\Response;
use WP_Error;

use function wp_remote_request;

Expand Down Expand Up @@ -60,6 +61,7 @@ public function handle(RequestInterface $request): ResponseInterface
$args = $this->prepareArgs($request);
$httpVer = $request->getProtocolVersion();

/** @var WP_Error|array $responseData */
$responseData = wp_remote_request($uri, $args);

$code = wp_remote_retrieve_response_code($responseData);
Expand Down

0 comments on commit a1c41ac

Please sign in to comment.