-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response decoding #7
Conversation
2a3dfba
to
1ea8d72
Compare
/** @var array */ | ||
private $data = []; | ||
|
||
private function __construct() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A private empty constructor means that this class cannot be instantiated.
/** @var array */ | ||
private $data = []; | ||
|
||
private function __construct() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A private empty constructor means that this class cannot be instantiated.
src/Model/CommandResponse.php
Outdated
|
||
public static function createFromRawCommandResponseObject(\stdClass $rawCommandResponseObject): self | ||
{ | ||
$commandResponse = new self(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be after the condition below
ebd89a6
to
d53f3ba
Compare
Response JSON is decoded to
Response
object, which then contains array ofCommandResponses
- responses to individual commands which were send as part of request batch.The
Response
could later maybe implement \Iterator, \ArrayAccess or maybe even \SplObjectStorage for simpler manipulation with the Command Responses. (see #8)Also note the compatibility layer for plain string command responses. It will be removed right after https://jira.int.lmc.cz/browse/RAD-643 is released.