Skip to content
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

Merged
merged 2 commits into from
Nov 15, 2017
Merged

Response decoding #7

merged 2 commits into from
Nov 15, 2017

Conversation

OndraM
Copy link
Member

@OndraM OndraM commented Nov 13, 2017

Response JSON is decoded to Response object, which then contains array of CommandResponses - 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.

/** @var array */
private $data = [];

private function __construct()
Copy link

@mvondr mvondr Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty constructor?

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()

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.


public static function createFromRawCommandResponseObject(\stdClass $rawCommandResponseObject): self
{
$commandResponse = new self();

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

@OndraM OndraM merged commit 46e010b into lmc-eu:master Nov 15, 2017
@OndraM OndraM added this to the 0.9 milestone Nov 23, 2017
@OndraM OndraM deleted the feature/responses branch January 15, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants