Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

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

    r41162 r42343  
    163163        $cookies = array();
    164164        foreach ( $this->response->cookies as $cookie ) {
    165             $cookies[] = new WP_Http_Cookie( array(
    166                 'name'    => $cookie->name,
    167                 'value'   => urldecode( $cookie->value ),
    168                 'expires' => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null,
    169                 'path'    => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null,
    170                 'domain'  => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null,
    171             ));
     165            $cookies[] = new WP_Http_Cookie(
     166                array(
     167                    'name'    => $cookie->name,
     168                    'value'   => urldecode( $cookie->value ),
     169                    'expires' => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null,
     170                    'path'    => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null,
     171                    'domain'  => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null,
     172                )
     173            );
    172174        }
    173175
     
    184186    public function to_array() {
    185187        return array(
    186             'headers' => $this->get_headers(),
    187             'body' => $this->get_data(),
     188            'headers'  => $this->get_headers(),
     189            'body'     => $this->get_data(),
    188190            'response' => array(
    189191                'code'    => $this->get_status(),
    190192                'message' => get_status_header_desc( $this->get_status() ),
    191193            ),
    192             'cookies' => $this->get_cookies(),
     194            'cookies'  => $this->get_cookies(),
    193195            'filename' => $this->filename,
    194196        );
Note: See TracChangeset for help on using the changeset viewer.