Make WordPress Core

Changeset 52025


Ignore:
Timestamp:
11/06/2021 09:55:50 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $strResponse argument to $str_response in WP_Http::processResponse().

This fixes a Variable "$strResponse" is not in valid snake_case format WPCS warning.

Additionally, rename a $res variable to $response for clarity.

Follow-up to [8516], [51823], [51826], [51877].

See #53359.

File:
1 edited

Legend:

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

    r51877 r52025  
    656656         * @since 2.7.0
    657657         *
    658          * @param string $strResponse The full response string.
     658         * @param string $str_response The full response string.
    659659         * @return array {
    660660         *     Array with response headers and body.
     
    664664         * }
    665665         */
    666         public static function processResponse( $strResponse ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    667                 $res = explode( "\r\n\r\n", $strResponse, 2 );
     666        public static function processResponse( $str_response ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
     667                $response = explode( "\r\n\r\n", $str_response, 2 );
    668668
    669669                return array(
    670                         'headers' => $res[0],
    671                         'body'    => isset( $res[1] ) ? $res[1] : '',
     670                        'headers' => $response[0],
     671                        'body'    => isset( $response[1] ) ? $response[1] : '',
    672672                );
    673673        }
Note: See TracChangeset for help on using the changeset viewer.