Properties

$version

$version : string

Type

string

$statusTexts

$statusTexts : array

Type

array

$statusCode

$statusCode : integer

Type

integer

$statusText

$statusText : string

Type

string

$parameters

$parameters : array

Type

array

$httpHeaders

$httpHeaders : array

Type

array

Methods

__construct()

__construct(array  $parameters = array(), integer  $statusCode = 200, array  $headers = array()) 

Parameters

array $parameters
integer $statusCode
array $headers

__toString()

__toString() : string

Converts the response object to string containing all headers and the response content.

Returns

string —

The response with headers and content

getStatusCode()

getStatusCode() : integer

Returns

integer

setStatusCode()

setStatusCode(integer  $statusCode, string  $text = null) 

Parameters

integer $statusCode
string $text

Throws

\InvalidArgumentException

getStatusText()

getStatusText() : string

Returns

string

getParameters()

getParameters() : array

Returns

array

setParameters()

setParameters(array  $parameters) 

Parameters

array $parameters

addParameters()

addParameters(array  $parameters) 

Parameters

array $parameters

getParameter()

getParameter(string  $name, mixed  $default = null) : mixed

Parameters

string $name
mixed $default

Returns

mixed

setParameter()

setParameter(string  $name, mixed  $value) 

Parameters

string $name
mixed $value

setHttpHeaders()

setHttpHeaders(array  $httpHeaders) 

Parameters

array $httpHeaders

setHttpHeader()

setHttpHeader(string  $name, mixed  $value) 

Parameters

string $name
mixed $value

addHttpHeaders()

addHttpHeaders(array  $httpHeaders) 

Parameters

array $httpHeaders

getHttpHeaders()

getHttpHeaders() : array

Returns

array

getHttpHeader()

getHttpHeader(string  $name, mixed  $default = null) : mixed

Parameters

string $name
mixed $default

Returns

mixed

getResponseBody()

getResponseBody(string  $format = 'json') : mixed

Parameters

string $format

Throws

\InvalidArgumentException

Returns

mixed

send()

send(string  $format = 'json') 

Parameters

string $format

setError()

setError(integer  $statusCode, string  $error, string  $errorDescription = null, string  $errorUri = null) : mixed

Parameters

integer $statusCode
string $error
string $errorDescription
string $errorUri

Throws

\InvalidArgumentException

Returns

mixed

setRedirect()

setRedirect(integer  $statusCode, string  $url, string  $state = null, string  $error = null, string  $errorDescription = null, string  $errorUri = null) : mixed

Parameters

integer $statusCode
string $url
string $state
string $error
string $errorDescription
string $errorUri

Throws

\InvalidArgumentException

Returns

mixed

isInvalid()

isInvalid() : Boolean

Returns

Boolean

isInformational()

isInformational() : Boolean

Returns

Boolean

isSuccessful()

isSuccessful() : Boolean

Returns

Boolean

isRedirection()

isRedirection() : Boolean

Returns

Boolean

isClientError()

isClientError() : Boolean

Returns

Boolean

isServerError()

isServerError() : Boolean

Returns

Boolean

buildHeader()

buildHeader(string  $name, string  $value) : string

Returns the build header line.

Parameters

string $name

The header name

string $value

The header value

Returns

string —

The built header line

getHttpHeadersAsString()

getHttpHeadersAsString(array  $headers) : string

Function from Symfony2 HttpFoundation - output pretty header

Parameters

array $headers

Returns

string

beautifyHeaderName()

beautifyHeaderName(string  $name) : mixed

Function from Symfony2 HttpFoundation - output pretty header

Parameters

string $name

Returns

mixed

beautifyCallback()

beautifyCallback(array  $match) : string

Function from Symfony2 HttpFoundation - output pretty header

Parameters

array $match

Returns

string