ResponseHandlerAbstract
in package
AbstractYes
Table of Contents
Methods
- handle() : ResponseDataContract
- Handle the JSON response after an initialization command.
- getResponseDataClass() : ResponseDataContract
- Get the response data class instance.
- getResponseFields() : array<string|int, mixed>
- Get the required response fields.
- check() : void
- Check if all required fields are present in the response.
- decode() : object
- Decode the JSON response string into an object.
Methods
handle()
Handle the JSON response after an initialization command.
public
handle(string $json) : ResponseDataContract
Parameters
- $json : string
-
The JSON response string.
Tags
Return values
ResponseDataContract —The response data contract.
getResponseDataClass()
Get the response data class instance.
protected
abstract getResponseDataClass() : ResponseDataContract
Return values
ResponseDataContract —The response data class instance.
getResponseFields()
Get the required response fields.
protected
abstract getResponseFields() : array<string|int, mixed>
Return values
array<string|int, mixed> —The required response fields.
check()
Check if all required fields are present in the response.
private
check(object $response) : void
Parameters
- $response : object
-
The decoded JSON response.
Tags
decode()
Decode the JSON response string into an object.
private
decode(string $json) : object
Parameters
- $json : string
-
The JSON response string.
Tags
Return values
object —The decoded JSON response as an object.