Skip to content

Commit d340f1f

Browse files
committed
Fix iteration on operations in bulkWrite()
1 parent adff7f0 commit d340f1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Collection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,17 @@ function (\stdClass $document) { return (array) $document; },
198198
*
199199
* @see Collection::getBulkOptions() for supported $options
200200
*
201-
* @param array $bulk Array of operations
201+
* @param array $ops Array of operations
202202
* @param array $options Additional options
203203
* @return WriteResult
204204
*/
205-
public function bulkWrite(array $bulk, array $options = array())
205+
public function bulkWrite(array $ops, array $options = array())
206206
{
207207
$options = array_merge($this->getBulkOptions(), $options);
208208

209209
$bulk = new BulkWrite($options["ordered"]);
210210

211-
foreach ($bulk as $n => $op) {
211+
foreach ($ops as $n => $op) {
212212
foreach ($op as $opname => $args) {
213213
if (!isset($args[0])) {
214214
throw new InvalidArgumentException(sprintf("Missing argument#1 for '%s' (operation#%d)", $opname, $n));

0 commit comments

Comments
 (0)