@@ -276,12 +276,8 @@ public function command(array|object $command, array $options = []): CursorInter
276
276
* @throws InvalidArgumentException for parameter/option parsing errors
277
277
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
278
278
*/
279
- public function createCollection (string $ collectionName , array $ options = []): array | object
279
+ public function createCollection (string $ collectionName , array $ options = []): void
280
280
{
281
- if (! isset ($ options ['typeMap ' ])) {
282
- $ options ['typeMap ' ] = $ this ->typeMap ;
283
- }
284
-
285
281
if (! isset ($ options ['writeConcern ' ]) && ! is_in_transaction ($ options )) {
286
282
$ options ['writeConcern ' ] = $ this ->writeConcern ;
287
283
}
@@ -296,7 +292,7 @@ public function createCollection(string $collectionName, array $options = []): a
296
292
297
293
$ server = select_server_for_write ($ this ->manager , $ options );
298
294
299
- return $ operation ->execute ($ server );
295
+ $ operation ->execute ($ server );
300
296
}
301
297
302
298
/**
@@ -314,17 +310,13 @@ public function createCollection(string $collectionName, array $options = []): a
314
310
* getPrevious() and getEncryptedFields() methods, respectively.
315
311
*
316
312
* @see CreateCollection::__construct() for supported options
317
- * @return array A tuple containing the command result document from creating the collection and the modified "encryptedFields" option
313
+ * @return array The modified "encryptedFields" option
318
314
* @throws InvalidArgumentException for parameter/option parsing errors
319
315
* @throws CreateEncryptedCollectionException for any errors creating data keys or creating the collection
320
316
* @throws UnsupportedException if Queryable Encryption is not supported by the selected server
321
317
*/
322
318
public function createEncryptedCollection (string $ collectionName , ClientEncryption $ clientEncryption , string $ kmsProvider , ?array $ masterKey , array $ options ): array
323
319
{
324
- if (! isset ($ options ['typeMap ' ])) {
325
- $ options ['typeMap ' ] = $ this ->typeMap ;
326
- }
327
-
328
320
if (! isset ($ options ['writeConcern ' ]) && ! is_in_transaction ($ options )) {
329
321
$ options ['writeConcern ' ] = $ this ->writeConcern ;
330
322
}
@@ -334,9 +326,9 @@ public function createEncryptedCollection(string $collectionName, ClientEncrypti
334
326
335
327
try {
336
328
$ operation ->createDataKeys ($ clientEncryption , $ kmsProvider , $ masterKey , $ encryptedFields );
337
- $ result = $ operation ->execute ($ server );
329
+ $ operation ->execute ($ server );
338
330
339
- return [ $ result , $ encryptedFields] ;
331
+ return $ encryptedFields ;
340
332
} catch (Throwable $ e ) {
341
333
throw new CreateEncryptedCollectionException ($ e , $ encryptedFields ?? []);
342
334
}
@@ -347,17 +339,12 @@ public function createEncryptedCollection(string $collectionName, ClientEncrypti
347
339
*
348
340
* @see DropDatabase::__construct() for supported options
349
341
* @param array $options Additional options
350
- * @return array|object Command result document
351
342
* @throws UnsupportedException if options are unsupported on the selected server
352
343
* @throws InvalidArgumentException for parameter/option parsing errors
353
344
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
354
345
*/
355
- public function drop (array $ options = []): array | object
346
+ public function drop (array $ options = []): void
356
347
{
357
- if (! isset ($ options ['typeMap ' ])) {
358
- $ options ['typeMap ' ] = $ this ->typeMap ;
359
- }
360
-
361
348
$ server = select_server_for_write ($ this ->manager , $ options );
362
349
363
350
if (! isset ($ options ['writeConcern ' ]) && ! is_in_transaction ($ options )) {
@@ -366,7 +353,7 @@ public function drop(array $options = []): array|object
366
353
367
354
$ operation = new DropDatabase ($ this ->databaseName , $ options );
368
355
369
- return $ operation ->execute ($ server );
356
+ $ operation ->execute ($ server );
370
357
}
371
358
372
359
/**
@@ -375,17 +362,12 @@ public function drop(array $options = []): array|object
375
362
* @see DropCollection::__construct() for supported options
376
363
* @param string $collectionName Collection name
377
364
* @param array $options Additional options
378
- * @return array|object Command result document
379
365
* @throws UnsupportedException if options are unsupported on the selected server
380
366
* @throws InvalidArgumentException for parameter/option parsing errors
381
367
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
382
368
*/
383
- public function dropCollection (string $ collectionName , array $ options = []): array | object
369
+ public function dropCollection (string $ collectionName , array $ options = []): void
384
370
{
385
- if (! isset ($ options ['typeMap ' ])) {
386
- $ options ['typeMap ' ] = $ this ->typeMap ;
387
- }
388
-
389
371
$ server = select_server_for_write ($ this ->manager , $ options );
390
372
391
373
if (! isset ($ options ['writeConcern ' ]) && ! is_in_transaction ($ options )) {
@@ -401,7 +383,7 @@ public function dropCollection(string $collectionName, array $options = []): arr
401
383
? new DropEncryptedCollection ($ this ->databaseName , $ collectionName , $ options )
402
384
: new DropCollection ($ this ->databaseName , $ collectionName , $ options );
403
385
404
- return $ operation ->execute ($ server );
386
+ $ operation ->execute ($ server );
405
387
}
406
388
407
389
/**
@@ -497,12 +479,8 @@ public function listCollections(array $options = []): CollectionInfoIterator
497
479
* @throws InvalidArgumentException for parameter/option parsing errors
498
480
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
499
481
*/
500
- public function modifyCollection (string $ collectionName , array $ collectionOptions , array $ options = []): array | object
482
+ public function modifyCollection (string $ collectionName , array $ collectionOptions , array $ options = []): void
501
483
{
502
- if (! isset ($ options ['typeMap ' ])) {
503
- $ options ['typeMap ' ] = $ this ->typeMap ;
504
- }
505
-
506
484
$ server = select_server_for_write ($ this ->manager , $ options );
507
485
508
486
if (! isset ($ options ['writeConcern ' ]) && ! is_in_transaction ($ options )) {
@@ -511,7 +489,7 @@ public function modifyCollection(string $collectionName, array $collectionOption
511
489
512
490
$ operation = new ModifyCollection ($ this ->databaseName , $ collectionName , $ collectionOptions , $ options );
513
491
514
- return $ operation ->execute ($ server );
492
+ $ operation ->execute ($ server );
515
493
}
516
494
517
495
/**
@@ -527,16 +505,12 @@ public function modifyCollection(string $collectionName, array $collectionOption
527
505
* @throws InvalidArgumentException for parameter/option parsing errors
528
506
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
529
507
*/
530
- public function renameCollection (string $ fromCollectionName , string $ toCollectionName , ?string $ toDatabaseName = null , array $ options = []): array | object
508
+ public function renameCollection (string $ fromCollectionName , string $ toCollectionName , ?string $ toDatabaseName = null , array $ options = []): void
531
509
{
532
510
if (! isset ($ toDatabaseName )) {
533
511
$ toDatabaseName = $ this ->databaseName ;
534
512
}
535
513
536
- if (! isset ($ options ['typeMap ' ])) {
537
- $ options ['typeMap ' ] = $ this ->typeMap ;
538
- }
539
-
540
514
$ server = select_server_for_write ($ this ->manager , $ options );
541
515
542
516
if (! isset ($ options ['writeConcern ' ]) && ! is_in_transaction ($ options )) {
@@ -545,7 +519,7 @@ public function renameCollection(string $fromCollectionName, string $toCollectio
545
519
546
520
$ operation = new RenameCollection ($ this ->databaseName , $ fromCollectionName , $ toDatabaseName , $ toCollectionName , $ options );
547
521
548
- return $ operation ->execute ($ server );
522
+ $ operation ->execute ($ server );
549
523
}
550
524
551
525
/**
0 commit comments