Make WordPress Core


Ignore:
Timestamp:
07/26/2020 10:43:47 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for WP_Http::processHeaders().

Document the @return value using hash notation.

Props marekdedic, valchovski, davidbaumwald, deepaklalwani, thimalw, SergeyBiryukov.
Fixes #48350.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r48586 r48630  
    668668
    669669    /**
    670      * Transform header string into an array.
    671      *
    672      * If an array is given, then it is assumed to be raw header data with numeric keys with the
    673      * headers as the values. No headers must be passed that were already processed.
     670     * Transforms header string into an array.
    674671     *
    675672     * @since 2.7.0
    676673     *
    677      * @param string|array $headers
    678      * @param string       $url     The URL that was requested.
    679      * @return array Processed string headers. If duplicate headers are encountered,
    680      *               then a numbered array is returned as the value of that header-key.
     674     * @param string|array $headers The original headers. If a string is passed, it will be converted
     675     *                              to an array. If an array is passed, then it is assumed to be
     676     *                              raw header data with numeric keys with the headers as the values.
     677     *                              No headers must be passed that were already processed.
     678     * @param string       $url     Optional. The URL that was requested. Default empty.
     679     * @return array {
     680     *     Processed string headers. If duplicate headers are encountered,
     681     *     then a numbered array is returned as the value of that header-key.
     682     *
     683     *     @type array            $response {
     684     *          @type int    $code    The response status code. Default 0.
     685     *          @type string $message The response message. Default empty.
     686     *     }
     687     *     @type array            $newheaders The processed header data as a multidimensional array.
     688     *     @type WP_Http_Cookie[] $cookies    If the original headers contain the 'Set-Cookie' key,
     689     *                                        an array containing `WP_Http_Cookie` objects is returned.
     690     * }
    681691     */
    682692    public static function processHeaders( $headers, $url = '' ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
Note: See TracChangeset for help on using the changeset viewer.