PHP Class VCR\Response

Mostrar archivo Open project: php-vcr/php-vcr Class Usage Examples

Protected Properties

Property Type Description
$body string
$curlInfo array
$headers array
$httpVersion
$status array

Public Methods

Method Description
__construct ( string | array $status, array $headers = [], string $body = null, array $curlInfo = [] )
fromArray ( array $response ) : Response Creates a new Response from a specified array.
getBody ( ) : string
getContentType ( )
getCurlInfo ( $option = null ) : array
getHeader ( $key )
getHeaders ( ) : array
getHttpVersion ( ) : mixed
getStatusCode ( ) : string
getStatusMessage ( ) : string
toArray ( ) : array Returns an array representation of this Response.

Protected Methods

Method Description
setStatus ( string | array $status )

Method Details

__construct() public method

public __construct ( string | array $status, array $headers = [], string $body = null, array $curlInfo = [] )
$status string | array
$headers array
$body string
$curlInfo array

fromArray() public static method

Creates a new Response from a specified array.
public static fromArray ( array $response ) : Response
$response array Array representation of a Response.
return Response A new Response from a specified array

getBody() public method

public getBody ( ) : string
return string

getContentType() public method

public getContentType ( )

getCurlInfo() public method

public getCurlInfo ( $option = null ) : array
return array

getHeader() public method

public getHeader ( $key )

getHeaders() public method

public getHeaders ( ) : array
return array

getHttpVersion() public method

public getHttpVersion ( ) : mixed
return mixed

getStatusCode() public method

public getStatusCode ( ) : string
return string

getStatusMessage() public method

public getStatusMessage ( ) : string
return string

setStatus() protected method

protected setStatus ( string | array $status )
$status string | array

toArray() public method

Returns an array representation of this Response.
public toArray ( ) : array
return array Array representation of this Request.

Property Details

$body protected_oe property

protected string $body
return string

$curlInfo protected_oe property

protected array $curlInfo
return array

$headers protected_oe property

protected array $headers
return array

$httpVersion protected_oe property

protected $httpVersion

$status protected_oe property

protected array $status
return array