Added new API endpoint for "email/unsubscribe" and fixed the response object#22
Added new API endpoint for "email/unsubscribe" and fixed the response object#22mwille wants to merge 2 commits intosnowcap:masterfrom
Conversation
| * | ||
| * @param array $data | ||
| * @return Response | ||
| */ |
There was a problem hiding this comment.
Why not name a method getUnsubscribedUsersCount and drop docblock comment?
There was a problem hiding this comment.
This method removes subscribtions, so a set fits better.
|
|
||
| /** | ||
| * Count the unsubscription statistics of a specific campaign. | ||
| * |
There was a problem hiding this comment.
Is there more specific type? In worse case could be @param mixed[] $data.
There was a problem hiding this comment.
I don't know what $data contains, so mixed[] should fit for now.
| function __construct(array $result = array()) | ||
| { | ||
| if (!isset($result['replyCode']) || !isset($result['replyText']) || !isset($result['data'])) { | ||
| if (!isset($result['replyCode']) || !isset($result['replyText']) || !array_key_exists('data', $result)) { |
There was a problem hiding this comment.
Can you please explain this modification?
There was a problem hiding this comment.
I'm not sure why @mwille did this, but I guess this can be dropped (the effect should be the same).
| $this->replyCode = $result['replyCode']; | ||
| $this->replyText = $result['replyText']; | ||
| $this->data = $result['data']; | ||
| $this->data = (array) $result['data']; |
There was a problem hiding this comment.
What will happen here if $result['data'] is not an array?
There was a problem hiding this comment.
This will force $this->data to be an array, it will be empty if $result['data'] is not an array (this might be better than mixed data types).
|
I'm sorry for the late answer. My colleague doesn't work anymore on the project where these changes were required. So I tried to answer your questions. |
|
Thank you for your response. Please update the PR and I will be happy to merge it. |
The new API endpoint depends on the changes in response constructor.