Conversation
| * | ||
| * @throws HTTPException | ||
| * | ||
| * @return array |
There was a problem hiding this comment.
The body of the response is an array? What type are the elements in the array exactly?
There was a problem hiding this comment.
There was a problem hiding this comment.
There was a problem hiding this comment.
Ok so it should also be
| * @return array | |
| * @return array<int, array<string, string>> |
correct?
SenseException
left a comment
There was a problem hiding this comment.
Thank you. Please add tests for your new added method.
Co-Authored-By: Grégoire Paris <postmaster@greg0ire.fr>
| * | ||
| * @return array | ||
| */ | ||
| public function bulkGet(array $docs = []) |
There was a problem hiding this comment.
Can we add a return type declaration here?
There was a problem hiding this comment.
I think this return type is too complex for method documentation. We can add a link to method's official documentation http://docs.couchdb.org/en/2.2.0/api/database/bulk-api.html#db-bulk-get
There was a problem hiding this comment.
Does it return other PHP types than array like the previous return annotation suggests?
There was a problem hiding this comment.
I was suggesting this
| public function bulkGet(array $docs = []) | |
| public function bulkGet(array $docs = []): array |
Co-Authored-By: Grégoire Paris <postmaster@greg0ire.fr>
| $docs = []; | ||
| $expectedRows = []; | ||
| foreach (range(1, 3) as $i) { | ||
| list($id, $rev) = $client->postDocument(['foo' => 'bar'.$i]); |
There was a problem hiding this comment.
| list($id, $rev) = $client->postDocument(['foo' => 'bar'.$i]); | |
| [$id, $rev] = $client->postDocument(['foo' => 'bar'.$i]); |
There was a problem hiding this comment.
The composer constraint is currently "php": ">=5.4", but I assume we are going to have at least 7.2 soon.
Co-Authored-By: Grégoire Paris <postmaster@greg0ire.fr>
Done |
|
Please associate your email address with your Github account, or change the |
SenseException
left a comment
There was a problem hiding this comment.
In addition to what @greg0ire wrote, we need to bump the minimum supported PHP version in composer.json. I suggest 7.2.
This method can be called to query several documents in bulk. It is well suited for fetching a specific revision of documents, as replicators do for example, or for getting revision history.