Skip to content

Commit 8a84911

Browse files
committed
Fix post response when json_decode results is an empty array - version bump
1 parent 4400ed4 commit 8a84911

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ or
1717
```
1818
{
1919
"require": {
20-
"recombee/php-api-client": "^2.0.0"
20+
"recombee/php-api-client": "^2.0.1"
2121
}
2222
}
2323
```

src/RecommApi/Client.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected function getOptionalHttpHeaders() {
112112
}
113113

114114
protected function getHttpHeaders() {
115-
return array_merge(array('User-Agent' => 'recombee-php-api-client/2.0.0'), $this->getOptionalHttpHeaders());
115+
return array_merge(array('User-Agent' => 'recombee-php-api-client/2.0.1'), $this->getOptionalHttpHeaders());
116116
}
117117

118118
protected function getOptionalRequestOptions() {
@@ -155,7 +155,6 @@ protected function post($uri, $timeout, $body) {
155155
$this->checkErrors($response);
156156

157157
$json = json_decode($response->body, true);
158-
159158
if($json !== null && json_last_error() == JSON_ERROR_NONE)
160159
return $json;
161160
else

src/RecommApi/Requests/MergeUsers.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
class MergeUsers extends Request {
1717

1818
/**
19-
* @var string $target_user_id ID of the source user.
19+
* @var string $target_user_id ID of the targer user.
2020
*/
2121
protected $target_user_id;
2222
/**
23-
* @var string $source_user_id ID of the target user.
23+
* @var string $source_user_id ID of the source user.
2424
*/
2525
protected $source_user_id;
2626
/**
@@ -34,8 +34,8 @@ class MergeUsers extends Request {
3434

3535
/**
3636
* Construct the request
37-
* @param string $target_user_id ID of the source user.
38-
* @param string $source_user_id ID of the target user.
37+
* @param string $target_user_id ID of the targer user.
38+
* @param string $source_user_id ID of the source user.
3939
* @param array $optional Optional parameters given as an array containing pairs name of the parameter => value
4040
* - Allowed parameters:
4141
* - *cascadeCreate*

0 commit comments

Comments
 (0)