Skip to content

Commit 593f744

Browse files
committed
Upgrade to Requests 2.0: documentation updates only
1 parent 0c34efe commit 593f744

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

src/wp-includes/class-wp-http-requests-hooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @since 4.7.0
1414
*
15-
* @see Requests_Hooks
15+
* @see WpOrg\Requests\Hooks
1616
*/
1717
#[AllowDynamicProperties]
1818
class WP_HTTP_Requests_Hooks extends WpOrg\Requests\Hooks {

src/wp-includes/class-wp-http-requests-response.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
/**
11-
* Core wrapper object for a Requests_Response for standardisation.
11+
* Core wrapper object for a WpOrg\Requests\Response for standardisation.
1212
*
1313
* @since 4.6.0
1414
*
@@ -19,7 +19,7 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
1919
* Requests Response object.
2020
*
2121
* @since 4.6.0
22-
* @var Requests_Response
22+
* @var \WpOrg\Requests\Response
2323
*/
2424
protected $response;
2525

@@ -36,8 +36,8 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
3636
*
3737
* @since 4.6.0
3838
*
39-
* @param Requests_Response $response HTTP response.
40-
* @param string $filename Optional. File name. Default empty.
39+
* @param \WpOrg\Requests\Response $response HTTP response.
40+
* @param string $filename Optional. File name. Default empty.
4141
*/
4242
public function __construct( WpOrg\Requests\Response $response, $filename = '' ) {
4343
$this->response = $response;
@@ -49,7 +49,7 @@ public function __construct( WpOrg\Requests\Response $response, $filename = '' )
4949
*
5050
* @since 4.6.0
5151
*
52-
* @return Requests_Response HTTP response.
52+
* @return WpOrg\Requests\Response HTTP response.
5353
*/
5454
public function get_response_object() {
5555
return $this->response;
@@ -60,7 +60,7 @@ public function get_response_object() {
6060
*
6161
* @since 4.6.0
6262
*
63-
* @return \Requests_Utility_CaseInsensitiveDictionary Map of header name to header value.
63+
* @return \WpOrg\Requests\Utility\CaseInsensitiveDictionary Map of header name to header value.
6464
*/
6565
public function get_headers() {
6666
// Ensure headers remain case-insensitive.

src/wp-includes/class-wp-http.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public function request( $url, $args = array() ) {
347347
$options['max_bytes'] = $parsed_args['limit_response_size'];
348348
}
349349

350-
// If we've got cookies, use and convert them to Requests_Cookie.
350+
// If we've got cookies, use and convert them to WpOrg\Requests\Cookie.
351351
if ( ! empty( $parsed_args['cookies'] ) ) {
352352
$options['cookies'] = WP_Http::normalize_cookies( $parsed_args['cookies'] );
353353
}
@@ -453,7 +453,7 @@ public function request( $url, $args = array() ) {
453453
* @since 4.6.0
454454
*
455455
* @param array $cookies Array of cookies to send with the request.
456-
* @return Requests_Cookie_Jar Cookie holder object.
456+
* @return WpOrg\Requests\Cookie\Jar Cookie holder object.
457457
*/
458458
public static function normalize_cookies( $cookies ) {
459459
$cookie_jar = new WpOrg\Requests\Cookie\Jar();
@@ -484,11 +484,11 @@ static function( $attr ) {
484484
*
485485
* @since 4.6.0
486486
*
487-
* @param string $location URL to redirect to.
488-
* @param array $headers Headers for the redirect.
489-
* @param string|array $data Body to send with the request.
490-
* @param array $options Redirect request options.
491-
* @param Requests_Response $original Response object.
487+
* @param string $location URL to redirect to.
488+
* @param array $headers Headers for the redirect.
489+
* @param string|array $data Body to send with the request.
490+
* @param array $options Redirect request options.
491+
* @param WpOrg\Requests\Response $original Response object.
492492
*/
493493
public static function browser_redirect_compatibility( $location, $headers, $data, &$options, $original ) {
494494
// Browser compatibility.
@@ -502,7 +502,7 @@ public static function browser_redirect_compatibility( $location, $headers, $dat
502502
*
503503
* @since 4.7.5
504504
*
505-
* @throws Requests_Exception On unsuccessful URL validation.
505+
* @throws WpOrg\Requests\Exception On unsuccessful URL validation.
506506
* @param string $location URL to redirect to.
507507
*/
508508
public static function validate_redirects( $location ) {

src/wp-includes/deprecated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3654,7 +3654,7 @@ function post_permalink( $post = 0 ) {
36543654
* @param string|bool $file_path Optional. File path to write request to. Default false.
36553655
* @param int $red Optional. The number of Redirects followed, Upon 5 being hit,
36563656
* returns false. Default 1.
3657-
* @return \Requests_Utility_CaseInsensitiveDictionary|false Headers on success, false on failure.
3657+
* @return \WpOrg\Requests\Utility\CaseInsensitiveDictionary|false Headers on success, false on failure.
36583658
*/
36593659
function wp_get_http( $url, $file_path = false, $red = 1 ) {
36603660
_deprecated_function( __FUNCTION__, '4.4.0', 'WP_Http' );

src/wp-includes/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ function do_enclose( $content, $post ) {
978978
*
979979
* @param string $url URL to retrieve HTTP headers from.
980980
* @param bool $deprecated Not Used.
981-
* @return \Requests_Utility_CaseInsensitiveDictionary|false Headers on success, false on failure.
981+
* @return \WpOrg\Requests\Utility\CaseInsensitiveDictionary|false Headers on success, false on failure.
982982
*/
983983
function wp_get_http_headers( $url, $deprecated = false ) {
984984
if ( ! empty( $deprecated ) ) {

src/wp-includes/http.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ function wp_remote_head( $url, $args = array() ) {
200200
* Retrieve only the headers from the raw response.
201201
*
202202
* @since 2.7.0
203-
* @since 4.6.0 Return value changed from an array to an Requests_Utility_CaseInsensitiveDictionary instance.
203+
* @since 4.6.0 Return value changed from an array to an WpOrg\Requests\Utility\CaseInsensitiveDictionary instance.
204204
*
205-
* @see \Requests_Utility_CaseInsensitiveDictionary
205+
* @see \WpOrg\Requests\Utility\CaseInsensitiveDictionary
206206
*
207207
* @param array|WP_Error $response HTTP response.
208-
* @return \Requests_Utility_CaseInsensitiveDictionary|array The headers of the response, or empty array
209-
* if incorrect parameter given.
208+
* @return \WpOrg\Requests\Utility\CaseInsensitiveDictionary|array The headers of the response, or empty array
209+
* if incorrect parameter given.
210210
*/
211211
function wp_remote_retrieve_headers( $response ) {
212212
if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {

tests/phpunit/tests/http/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function test_get_cookie_host_only() {
231231
$this->assertSame( $cookie->domain, 'wordpress.org' );
232232
$this->assertFalse( $cookie->host_only, 'host-only flag not set' );
233233

234-
// Regurgitate (Requests_Cookie -> WP_Http_Cookie -> Requests_Cookie).
234+
// Regurgitate (WpOrg\Requests\Cookie -> WP_Http_Cookie -> WpOrg\Requests\Cookie).
235235
$cookies = WP_Http::normalize_cookies( wp_remote_retrieve_cookies( $response ) );
236236
$this->assertFalse( $cookies['test']->flags['host-only'], 'host-only flag data lost' );
237237
}

0 commit comments

Comments
 (0)