Skip to content

Commit c01498e

Browse files
committed
Supply the data as an array
1 parent 972e2ea commit c01498e

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/PHPCouchDB/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function create($doc)
9292
if ($response->getStatusCode() == 201 && $response_data = json_decode($response->getBody(), true)) {
9393
$id = $response_data['id'];
9494
// all good. Let's fetch the doc and return it
95-
$fetched_data = json_decode($this->client->get('/' . $this->db_name . '/' . $id)->getBody());
95+
$fetched_data = json_decode($this->client->get('/' . $this->db_name . '/' . $id)->getBody(), true);
9696
return new Document($this->client, $this->db_name, $fetched_data);
9797
}
9898
} catch (\GuzzleHttp\Exception\ConnectException $e) {

src/PHPCouchDB/Document.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class Document
2525
* @param string $db_name The database this document is in
2626
* @param array $data Representation of the document
2727
*/
28-
*/
2928

3029
public function __construct(\GuzzleHttp\ClientInterface $client, string $db_name, array $data)
3130
{

0 commit comments

Comments
 (0)