Docs: Add missing inline documentation in WP_HTTP_Requests_Response.

* Adds a missing file header
* Adjusts class DocBlock
* Adds missing version and access information for all methods

See #37318, [37428] and #33055.

Built from https://develop.svn.wordpress.org/trunk@38120


git-svn-id: http://core.svn.wordpress.org/trunk@38061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2016-07-20 16:34:29 +00:00
parent 868804db15
commit 1ce9a3d800
2 changed files with 54 additions and 7 deletions

View File

@ -1,16 +1,25 @@
<?php <?php
/** /**
* Wrapper object for a Requests_Response for standardisation. * HTTP API: WP_HTTP_Requests_Response class
* *
* @package WordPress * @package WordPress
* @subpackage HTTP * @subpackage HTTP
* @since 4.6.0 * @since 4.6.0
*/ */
/**
* Core wrapper object for a Requests_Response for standardisation.
*
* @since 4.6.0
*
* @see WP_HTTP_Response
*/
class WP_HTTP_Requests_Response extends WP_HTTP_Response { class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Requests Response object. * Requests Response object.
* *
* @since 4.6.0
* @access protected
* @var Requests_Response * @var Requests_Response
*/ */
protected $response; protected $response;
@ -18,12 +27,20 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Filename the response was saved to. * Filename the response was saved to.
* *
* @since 4.6.0
* @access protected
* @var string|null * @var string|null
*/ */
protected $filename; protected $filename;
/** /**
* Constructor. * Constructor.
*
* @since 4.6.0
* @access public
*
* @param Requests_Response $response HTTP response.
* @param string $filename Optional. File name. Default empty.
*/ */
public function __construct( Requests_Response $response, $filename = '' ) { public function __construct( Requests_Response $response, $filename = '' ) {
$this->response = $response; $this->response = $response;
@ -31,9 +48,12 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
} }
/** /**
* Get the response object for the request. * Retrieves the response object for the request.
* *
* @return Requests_Response * @since 4.6.0
* @access public
*
* @return Requests_Response HTTP response.
*/ */
public function get_response_object() { public function get_response_object() {
return $this->response; return $this->response;
@ -42,6 +62,9 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Retrieves headers associated with the response. * Retrieves headers associated with the response.
* *
* @since 4.6.0
* @access public
*
* @return array Map of header name to header value. * @return array Map of header name to header value.
*/ */
public function get_headers() { public function get_headers() {
@ -63,6 +86,9 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Sets all header values. * Sets all header values.
* *
* @since 4.6.0
* @access public
*
* @param array $headers Map of header name to header value. * @param array $headers Map of header name to header value.
*/ */
public function set_headers( $headers ) { public function set_headers( $headers ) {
@ -72,6 +98,9 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Sets a single HTTP header. * Sets a single HTTP header.
* *
* @since 4.6.0
* @access public
*
* @param string $key Header name. * @param string $key Header name.
* @param string $value Header value. * @param string $value Header value.
* @param bool $replace Optional. Whether to replace an existing header of the same name. * @param bool $replace Optional. Whether to replace an existing header of the same name.
@ -88,6 +117,9 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Retrieves the HTTP return code for the response. * Retrieves the HTTP return code for the response.
* *
* @since 4.6.0
* @access public
*
* @return int The 3-digit HTTP status code. * @return int The 3-digit HTTP status code.
*/ */
public function get_status() { public function get_status() {
@ -97,6 +129,9 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Sets the 3-digit HTTP status code. * Sets the 3-digit HTTP status code.
* *
* @since 4.6.0
* @access public
*
* @param int $code HTTP status. * @param int $code HTTP status.
*/ */
public function set_status( $code ) { public function set_status( $code ) {
@ -106,6 +141,9 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Retrieves the response data. * Retrieves the response data.
* *
* @since 4.6.0
* @access public
*
* @return mixed Response data. * @return mixed Response data.
*/ */
public function get_data() { public function get_data() {
@ -115,6 +153,9 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
/** /**
* Sets the response data. * Sets the response data.
* *
* @since 4.6.0
* @access public
*
* @param mixed $data Response data. * @param mixed $data Response data.
*/ */
public function set_data( $data ) { public function set_data( $data ) {
@ -122,7 +163,10 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
} }
/** /**
* Get cookies from the response. * Retrieves cookies from the response.
*
* @since 4.6.0
* @access public
* *
* @return WP_HTTP_Cookie[] List of cookie objects. * @return WP_HTTP_Cookie[] List of cookie objects.
*/ */
@ -142,7 +186,10 @@ class WP_HTTP_Requests_Response extends WP_HTTP_Response {
} }
/** /**
* Convert the object to a WP_Http response array. * Converts the object to a WP_Http response array.
*
* @since 4.6.0
* @access public
* *
* @return array WP_Http response array, per WP_Http::request(). * @return array WP_Http response array, per WP_Http::request().
*/ */

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-beta3-38119'; $wp_version = '4.6-beta3-38120';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.