InitializationCommandResponseHandler
extends ResponseHandlerAbstract
in package
Class InitializationCommandResponseHandler
Handles the response received after an initialization command and ensures it contains all required fields.
Table of Contents
Methods
- handle() : ResponseDataContract
- Handle the JSON response after an initialization command.
- getResponseDataClass() : ResponseDataContract
- Get the response data class.
- getResponseFields() : array<string|int, mixed>|array<string|int, string>
- Get 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.
protected
getResponseDataClass() : ResponseDataContract
Return values
ResponseDataContract —The response data contract.
getResponseFields()
Get required response fields.
protected
getResponseFields() : array<string|int, mixed>|array<string|int, string>
Return values
array<string|int, mixed>|array<string|int, string>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.