Response
in package
Tags
Table of Contents
- $apiError : ApiError|int
- $body : array<string|int, mixed>
- $data : array<string|int, mixed>|null
- $headers : array<string|int, mixed>
- $httpCode : int
- $message : string
- $status : ApiStatus
- $apiError : ApiError
- The api error
- $body : string
- The response body
- $headers : string
- The response headers
- $httpCode : int
- The response http code
- $message : string
- The interface message
- $response : ResponseInterface
- PSR response
- $status : ApiStatus
- The response status
- __construct() : mixed
- __get() : mixed
- checkVersion() : mixed
- tryDecodeJson() : mixed
- Try to decode json and return false if it is not a valid json
Properties
$apiError
public
ApiError|int
$apiError
The api error status it there is any
$body
public
array<string|int, mixed>
$body
The http response body, this is parsed json
$data
public
array<string|int, mixed>|null
$data
The reponse data
$headers
public
array<string|int, mixed>
$headers
The http reponse headers
$httpCode
public
int
$httpCode
The http response code
$message
public
string
$message
The api message
$status
public
ApiStatus
$status
The response api status
$apiError
The api error
private
ApiError
$apiError
$body
The response body
private
string
$body
$headers
The response headers
private
string
$headers
$httpCode
The response http code
private
int
$httpCode
= 0
$message
The interface message
private
string
$message
$response
PSR response
private
ResponseInterface
$response
$status
The response status
private
ApiStatus
$status
Methods
__construct()
public
__construct(ApiStatus $status, ResponseInterface $response) : mixed
Parameters
- $status : ApiStatus
- $response : ResponseInterface
Return values
mixed —__get()
public
__get(mixed $field) : mixed
Parameters
- $field : mixed
Return values
mixed —checkVersion()
private
checkVersion(string $version) : mixed
Parameters
- $version : string
Return values
mixed —tryDecodeJson()
Try to decode json and return false if it is not a valid json
private
tryDecodeJson(string $string) : mixed
Parameters
- $string : string