Properties

$

$ : string|null

RequestId

Type

string|null

$dot

$dot : \Adbar\Dot

Instance of the Dot.

Type

\Adbar\Dot

$phrases

$phrases : array

Type

array — Map of standard HTTP status code/reason phrases

$reasonPhrase

$reasonPhrase : string

Type

string

$statusCode

$statusCode : integer

Type

integer

$headers

$headers : array

Type

array — Map of all registered headers, as original name => array of values

$headerNames

$headerNames : array

Type

array — Map of lowercase header name => original name at registration

$protocol

$protocol : string

Type

string

Methods

search()

search(string  $expression) : mixed|null

Parameters

string $expression

Returns

mixed|null

clear()

clear(array|integer|string|null  $keys = null) 

Delete the contents of a given key or keys

Parameters

array|integer|string|null $keys

flatten()

flatten(string  $delimiter = '.', array|null  $items = null, string  $prepend = '') : array

Flatten an array with the given character as a key delimiter

Parameters

string $delimiter
array|null $items
string $prepend

Returns

array

get()

get(integer|string|null  $key = null, mixed  $default = null) : mixed

Return the value of a given key

Parameters

integer|string|null $key
mixed $default

Returns

mixed

set()

set(array|integer|string  $keys, mixed  $value = null) 

Set a given key / value pair or pairs

Parameters

array|integer|string $keys
mixed $value

isEmpty()

isEmpty(array|integer|string|null  $keys = null) : boolean

Check if a given key or keys are empty

Parameters

array|integer|string|null $keys

Returns

boolean

setReference()

setReference(array  $items) 

Replace all items with a given array as a reference

Parameters

array $items

toJson()

toJson(mixed  $key = null, integer  $options) : string

Return the value of a given key or all the values as JSON

Parameters

mixed $key
integer $options

Returns

string

toArray()

toArray() : array

Returns

array

offsetExists()

offsetExists(integer|string  $key) : boolean

Check if a given key exists

Parameters

integer|string $key

Returns

boolean

offsetGet()

offsetGet(integer|string  $key) : mixed

Return the value of a given key

Parameters

integer|string $key

Returns

mixed

offsetSet()

offsetSet(integer|string|null  $key, mixed  $value) 

Set a given value to the given key

Parameters

integer|string|null $key
mixed $value

offsetUnset()

offsetUnset(integer|string  $key) 

Delete the given key

Parameters

integer|string $key

delete()

delete(array|integer|string  $keys) 

Delete the given key or keys

Parameters

array|integer|string $keys

count()

count(integer|string|null  $key = null) : integer

Return the number of items in a given key

Parameters

integer|string|null $key

Returns

integer

getIterator()

getIterator() : \ArrayIterator

Get an iterator for the stored items

Returns

\ArrayIterator

jsonSerialize()

jsonSerialize() : array

Return items for JSON serialization

Returns

array

__get()

__get(string  $name) : mixed|null

Parameters

string $name

Returns

mixed|null

all()

all() : array

Return all the stored items

Returns

array

__set()

__set(string  $name, mixed  $value) 

Parameters

string $name
mixed $value

add()

add(array|integer|string  $keys, mixed  $value = null) 

Set a given key / value pair or pairs if the key doesn't exist already

Parameters

array|integer|string $keys
mixed $value

__isset()

__isset(string  $name) : boolean

Parameters

string $name

Returns

boolean

has()

has(array|integer|string  $keys) : boolean

Check if a given key or keys exists

Parameters

array|integer|string $keys

Returns

boolean

__unset()

__unset(  $name) : void

Parameters

$name

getStatusCode()

getStatusCode() : integer

Gets the response status code.

The status code is a 3-digit integer result code of the server's attempt to understand and satisfy the request.

Returns

integer —

Status code.

getReasonPhrase()

getReasonPhrase() : string

Gets the response reason phrase associated with the status code.

Because a reason phrase is not a required element in a response status line, the reason phrase value MAY be null. Implementations MAY choose to return the default RFC 7231 recommended reason phrase (or those listed in the IANA HTTP Status Code Registry) for the response's status code.

Returns

string —

Reason phrase; must return an empty string if none present.

withStatus()

withStatus(integer  $code, string  $reasonPhrase = '') : static

Return an instance with the specified status code and, optionally, reason phrase.

If no reason phrase is specified, implementations MAY choose to default to the RFC 7231 or IANA recommended reason phrase for the response's status code.

This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the updated status and reason phrase.

Parameters

integer $code

The 3-digit integer result code to set.

string $reasonPhrase

The reason phrase to use with the provided status code; if none is provided, implementations MAY use the defaults as suggested in the HTTP specification.

Returns

static

getProtocolVersion()

getProtocolVersion() 

withProtocolVersion()

withProtocolVersion(  $version) 

Parameters

$version

getHeaders()

getHeaders() 

hasHeader()

hasHeader(  $header) 

Parameters

$header

getHeader()

getHeader(  $header) 

Parameters

$header

getHeaderLine()

getHeaderLine(  $header) 

Parameters

$header

withHeader()

withHeader(  $header,   $value) 

Parameters

$header
$value

withAddedHeader()

withAddedHeader(  $header,   $value) 

Parameters

$header
$value

withoutHeader()

withoutHeader(  $header) 

Parameters

$header

getBody()

getBody() 

__toString()

__toString() : string

Returns

string

isSuccess()

isSuccess() : boolean

Returns

boolean

dot()

dot(array  $data = array()) 

Parameters

array $data

assertStatusCodeIsInteger()

assertStatusCodeIsInteger(  $statusCode) 

Parameters

$statusCode

assertStatusCodeRange()

assertStatusCodeRange(  $statusCode) 

Parameters

$statusCode

setHeaders()

setHeaders(array  $headers) 

Parameters

array $headers

normalizeHeaderValue()

normalizeHeaderValue(  $value) 

Parameters

$value

trimHeaderValues()

trimHeaderValues(array<mixed,string>  $values) : array<mixed,string>

Trims whitespace from the header values.

Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.

header-field = field-name ":" OWS field-value OWS OWS = *( SP / HTAB )

Parameters

array<mixed,string> $values

Header values

Returns

array<mixed,string> —

Trimmed header values

assertHeader()

assertHeader(  $header) 

Parameters

$header

resolveData()

resolveData() 

getRequestFormat()

getRequestFormat() : string

Returns

string

jsonToArray()

jsonToArray(string  $response) : array

Parameters

string $response

Returns

array

xmlToArray()

xmlToArray(string  $string) : array

Parameters

string $string

Returns

array