Skip to content

Commit ed1b85e

Browse files
committed
Add the WP_Http methods.
1 parent 5c6b234 commit ed1b85e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

additionalParams.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111
'wp_safe_remote_head' => [$httpReturnType],
1212
'wp_safe_remote_post' => [$httpReturnType],
1313
'wp_safe_remote_request' => [$httpReturnType],
14+
'WP_Http::get' => [$httpReturnType],
15+
'WP_Http::head' => [$httpReturnType],
16+
'WP_Http::post' => [$httpReturnType],
17+
'WP_Http::request' => [$httpReturnType],
1418
];

wordpress-stubs.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40697,6 +40697,7 @@ class WP_Http
4069740697
* filename?: string,
4069840698
* limit_response_size?: int,
4069940699
* } $args
40700+
* @phpstan-return array{headers:Requests_Utility_CaseInsensitiveDictionary,body:string,response:array{code:int,message:string},cookies:array<int,WP_HTTP_Cookie>,filename:string|null,http_response:WP_HTTP_Requests_Response}|WP_Error
4070040701
*/
4070140702
public function request($url, $args = array())
4070240703
{
@@ -40785,6 +40786,7 @@ private function _dispatch_request($url, $args)
4078540786
* @param string|array $args Optional. Override the defaults.
4078640787
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.
4078740788
* A WP_Error instance upon error.
40789+
* @phpstan-return array{headers:Requests_Utility_CaseInsensitiveDictionary,body:string,response:array{code:int,message:string},cookies:array<int,WP_HTTP_Cookie>,filename:string|null,http_response:WP_HTTP_Requests_Response}|WP_Error
4078840790
*/
4078940791
public function post($url, $args = array())
4079040792
{
@@ -40800,6 +40802,7 @@ public function post($url, $args = array())
4080040802
* @param string|array $args Optional. Override the defaults.
4080140803
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.
4080240804
* A WP_Error instance upon error.
40805+
* @phpstan-return array{headers:Requests_Utility_CaseInsensitiveDictionary,body:string,response:array{code:int,message:string},cookies:array<int,WP_HTTP_Cookie>,filename:string|null,http_response:WP_HTTP_Requests_Response}|WP_Error
4080340806
*/
4080440807
public function get($url, $args = array())
4080540808
{
@@ -40815,6 +40818,7 @@ public function get($url, $args = array())
4081540818
* @param string|array $args Optional. Override the defaults.
4081640819
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.
4081740820
* A WP_Error instance upon error.
40821+
* @phpstan-return array{headers:Requests_Utility_CaseInsensitiveDictionary,body:string,response:array{code:int,message:string},cookies:array<int,WP_HTTP_Cookie>,filename:string|null,http_response:WP_HTTP_Requests_Response}|WP_Error
4081840822
*/
4081940823
public function head($url, $args = array())
4082040824
{

0 commit comments

Comments
 (0)