src/VCR/Response.php
public static function fromArray(array $response)
    {
        $body = isset($response['body']) ? $response['body'] : null;

        $gzip = isset($response['headers']['Content-Type'])
            && strpos($response['headers']['Content-Type'], 'application/x-gzip') !== false;

        $binary = isset($response['headers']['Content-Transfer-Encoding'])
            && $response['headers']['Content-Transfer-Encoding'] == 'binary';

        // Base64 decode when binary
        if ($gzip || $binary) {
            $body = base64_decode($response['body']);
        }

        return new static(
            isset($response['status']) ? $response['status'] : 200,
            isset($response['headers']) ? $response['headers'] : array(),
            $body
        );
    }
public static function fromArray(array $response)
    {
        $body = isset($response['body']) ? $response['body'] : null;

        $gzip = isset($response['headers']['Content-Type'])
            && strpos($response['headers']['Content-Type'], 'application/x-gzip') !== false;

        $binary = isset($response['headers']['Content-Transfer-Encoding'])
            && $response['headers']['Content-Transfer-Encoding'] == 'binary';

        // Base64 decode when binary
        if ($gzip || $binary) {
            $body = base64_decode($response['body']);
        }

        return new static(
            isset($response['status']) ? $response['status'] : 200,
            isset($response['headers']) ? $response['headers'] : array(),
            $body
        );
    }
public static function fromArray ( array $ response ) { $ body = isset ( $ response [ 'body' ] ) ? $ response [ 'body' ] : null ; $ gzip = isset ( $ response [ 'headers' ] [ 'Content-Type' ] ) && strpos ( $ response [ 'headers' ] [ 'Content-Type' ] , 'application/x-gzip' ) !== false ; $ binary = isset ( $ response [ 'headers' ] [ 'Content-Transfer-Encoding' ] ) && $ response [ 'headers' ] [ 'Content-Transfer-Encoding' ] == 'binary' ; // Base64 decode when binary if ( $ gzip || $ binary ) { $ body = base64_decode ( $ response [ 'body' ] ) ; } return new static ( isset ( $ response [ 'status' ] ) ? $ response [ 'status' ] : 200 , isset ( $ response [ 'headers' ] ) ? $ response [ 'headers' ] : array ( ) , $ body ) ; }
Creates a new Response from a specified array.

@param  array  $response Array representation of a Response.
@return Response A new Response from a specified array
Creates a new Response from a specified array .