NCRequestResult
in package
implements
JsonSerializable
Uses
TArrayTools
Interfaces, Classes, Traits and Enums
- JsonSerializable
Table of Contents
- TYPE_BINARY = 1
- TYPE_JSON = 2
- TYPE_STRING = 0
- TYPE_XRD = 3
- $TYPE_ARRAY : mixed
- $TYPE_BOOLEAN : mixed
- $TYPE_INTEGER : mixed
- $TYPE_NULL : mixed
- $TYPE_SERIALIZABLE : mixed
- $TYPE_STRING : mixed
- $content : mixed
- $contentAsArray : array<string|int, mixed>
- $contentType : int
- $exception : BadResponseException
- $headers : array<string|int, mixed>
- $statusCode : int
- __construct() : mixed
- NCRequestResult constructor.
- getAsArray() : array<string|int, mixed>
- getBinary() : string
- getContent() : string
- getContentType() : int
- getException() : BadResponseException
- getHeader() : array<string|int, mixed>
- getHeaders() : array<string|int, mixed>
- getStatusCode() : int
- hasException() : bool
- isContentType() : bool
- jsonSerialize() : array<string|int, mixed>
- setContent() : self
- setContentType() : $this
- setException() : self
- setHeaders() : self
- setStatusCode() : self
- typeOf() : string
- validKey() : bool
- withinHeader() : bool
- cleanArray() : mixed
- extractArray() : mixed
- get() : string
- getArray() : array<string|int, mixed>
- getBool() : bool
- getFloat() : float
- getInt() : int
- getList() : array<string|int, mixed>
- getObj() : mixed
- mustContains() : mixed
- discoverContentType() : int
- generateContentAsArray() : void
- generateMeta() : void
Constants
TYPE_BINARY
public
mixed
TYPE_BINARY
= 1
TYPE_JSON
public
mixed
TYPE_JSON
= 2
TYPE_STRING
public
mixed
TYPE_STRING
= 0
TYPE_XRD
public
mixed
TYPE_XRD
= 3
Properties
$TYPE_ARRAY
public
static mixed
$TYPE_ARRAY
= 'Array'
$TYPE_BOOLEAN
public
static mixed
$TYPE_BOOLEAN
= 'Boolean'
$TYPE_INTEGER
public
static mixed
$TYPE_INTEGER
= 'Integer'
$TYPE_NULL
public
static mixed
$TYPE_NULL
= 'Null'
$TYPE_SERIALIZABLE
public
static mixed
$TYPE_SERIALIZABLE
= 'Serializable'
$TYPE_STRING
public
static mixed
$TYPE_STRING
= 'String'
$content
private
mixed
$content
$contentAsArray
private
array<string|int, mixed>
$contentAsArray
= []
$contentType
private
int
$contentType
= 0
$exception
private
BadResponseException
$exception
= null
$headers
private
array<string|int, mixed>
$headers
= []
$statusCode
private
int
$statusCode
= 0
Methods
__construct()
NCRequestResult constructor.
public
__construct(IResponse|null $response[, BadResponseException|null $e = null ]) : mixed
Parameters
- $response : IResponse|null
- $e : BadResponseException|null = null
Return values
mixed —getAsArray()
public
getAsArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —getBinary()
public
getBinary() : string
Return values
string —getContent()
public
getContent() : string
Tags
Return values
string —getContentType()
public
getContentType() : int
Return values
int —getException()
public
getException() : BadResponseException
Return values
BadResponseException —getHeader()
public
getHeader(string $key) : array<string|int, mixed>
Parameters
- $key : string
Return values
array<string|int, mixed> —getHeaders()
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —getStatusCode()
public
getStatusCode() : int
Return values
int —hasException()
public
hasException() : bool
Return values
bool —isContentType()
public
isContentType(int $type) : bool
Parameters
- $type : int
Return values
bool —jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —setContent()
public
setContent(string $content) : self
Parameters
- $content : string
Return values
self —setContentType()
public
setContentType(int $type) : $this
Parameters
- $type : int
Return values
$this —setException()
public
setException(BadResponseException $e) : self
Parameters
- $e : BadResponseException
Return values
self —setHeaders()
public
setHeaders(array<string|int, mixed> $headers) : self
Parameters
- $headers : array<string|int, mixed>
Return values
self —setStatusCode()
public
setStatusCode(int $statusCode) : self
Parameters
- $statusCode : int
Return values
self —typeOf()
public
typeOf(string $key, array<string|int, mixed> $arr[, bool $root = true ]) : string
Parameters
- $key : string
- $arr : array<string|int, mixed>
- $root : bool = true
Tags
Return values
string —validKey()
public
validKey(string $k, array<string|int, mixed> $arr) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
Return values
bool —withinHeader()
public
withinHeader(string $key, string $needle) : bool
Parameters
- $key : string
- $needle : string
Return values
bool —cleanArray()
protected
cleanArray(array<string|int, mixed> &$arr) : mixed
Parameters
- $arr : array<string|int, mixed>
Return values
mixed —extractArray()
protected
extractArray(string $k, string $value, array<string|int, mixed> $list) : mixed
Parameters
- $k : string
- $value : string
- $list : array<string|int, mixed>
Tags
Return values
mixed —get()
protected
get(string $k, array<string|int, mixed> $arr[, string $default = '' ]) : string
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : string = ''
Return values
string —getArray()
protected
getArray(string $k, array<string|int, mixed> $arr[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getBool()
protected
getBool(string $k, array<string|int, mixed> $arr[, bool $default = false ]) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : bool = false
Return values
bool —getFloat()
protected
getFloat(string $k, array<string|int, mixed> $arr, float $default) : float
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : float
Return values
float —getInt()
protected
getInt(string $k, array<string|int, mixed> $arr, int $default) : int
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : int
Return values
int —getList()
protected
getList(string $k, array<string|int, mixed> $arr, array<string|int, mixed> $import[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $import : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getObj()
protected
getObj(string $k, array<string|int, mixed> $arr[, JsonSerializable|null $default = null ]) : mixed
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : JsonSerializable|null = null
Return values
mixed —mustContains()
protected
mustContains(array<string|int, mixed> $keys, array<string|int, mixed> $arr) : mixed
Parameters
- $keys : array<string|int, mixed>
- $arr : array<string|int, mixed>
Tags
Return values
mixed —discoverContentType()
private
discoverContentType() : int
Return values
int —generateContentAsArray()
private
generateContentAsArray() : void
Return values
void —generateMeta()
private
generateMeta() : void