@@ -501,15 +501,13 @@ public function distinct(string $fieldName, array|object $filter = [], array $op
501
501
*
502
502
* @see DropCollection::__construct() for supported options
503
503
* @param array $options Additional options
504
- * @return array|object Command result document
505
504
* @throws UnsupportedException if options are not supported by the selected server
506
505
* @throws InvalidArgumentException for parameter/option parsing errors
507
506
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
508
507
*/
509
- public function drop (array $ options = []): array | object
508
+ public function drop (array $ options = []): void
510
509
{
511
510
$ options = $ this ->inheritWriteOptions ($ options );
512
- $ options = $ this ->inheritTypeMap ($ options , __FUNCTION__ );
513
511
514
512
$ server = select_server_for_write ($ this ->manager , $ options );
515
513
@@ -522,7 +520,7 @@ public function drop(array $options = []): array|object
522
520
? new DropEncryptedCollection ($ this ->databaseName , $ this ->collectionName , $ options )
523
521
: new DropCollection ($ this ->databaseName , $ this ->collectionName , $ options );
524
522
525
- return $ operation ->execute ($ server );
523
+ $ operation ->execute ($ server );
526
524
}
527
525
528
526
/**
@@ -531,12 +529,11 @@ public function drop(array $options = []): array|object
531
529
* @see DropIndexes::__construct() for supported options
532
530
* @param string|IndexInfo $indexName Index name or model object
533
531
* @param array $options Additional options
534
- * @return array|object Command result document
535
532
* @throws UnsupportedException if options are not supported by the selected server
536
533
* @throws InvalidArgumentException for parameter/option parsing errors
537
534
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
538
535
*/
539
- public function dropIndex (string |IndexInfo $ indexName , array $ options = []): array | object
536
+ public function dropIndex (string |IndexInfo $ indexName , array $ options = []): void
540
537
{
541
538
$ indexName = (string ) $ indexName ;
542
539
@@ -545,31 +542,28 @@ public function dropIndex(string|IndexInfo $indexName, array $options = []): arr
545
542
}
546
543
547
544
$ options = $ this ->inheritWriteOptions ($ options );
548
- $ options = $ this ->inheritTypeMap ($ options , __FUNCTION__ );
549
545
550
546
$ operation = new DropIndexes ($ this ->databaseName , $ this ->collectionName , $ indexName , $ options );
551
547
552
- return $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
548
+ $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
553
549
}
554
550
555
551
/**
556
552
* Drop all indexes in the collection.
557
553
*
558
554
* @see DropIndexes::__construct() for supported options
559
555
* @param array $options Additional options
560
- * @return array|object Command result document
561
556
* @throws UnsupportedException if options are not supported by the selected server
562
557
* @throws InvalidArgumentException for parameter/option parsing errors
563
558
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
564
559
*/
565
- public function dropIndexes (array $ options = []): array | object
560
+ public function dropIndexes (array $ options = []): void
566
561
{
567
562
$ options = $ this ->inheritWriteOptions ($ options );
568
- $ options = $ this ->inheritTypeMap ($ options , __FUNCTION__ );
569
563
570
564
$ operation = new DropIndexes ($ this ->databaseName , $ this ->collectionName , '* ' , $ options );
571
565
572
- return $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
566
+ $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
573
567
}
574
568
575
569
/**
@@ -909,23 +903,21 @@ public function listSearchIndexes(array $options = []): Iterator
909
903
* @param string $toCollectionName New name of the collection
910
904
* @param string|null $toDatabaseName New database name of the collection. Defaults to the original database.
911
905
* @param array $options Additional options
912
- * @return array|object Command result document
913
906
* @throws UnsupportedException if options are not supported by the selected server
914
907
* @throws InvalidArgumentException for parameter/option parsing errors
915
908
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
916
909
*/
917
- public function rename (string $ toCollectionName , ?string $ toDatabaseName = null , array $ options = []): array | object
910
+ public function rename (string $ toCollectionName , ?string $ toDatabaseName = null , array $ options = []): void
918
911
{
919
912
if (! isset ($ toDatabaseName )) {
920
913
$ toDatabaseName = $ this ->databaseName ;
921
914
}
922
915
923
916
$ options = $ this ->inheritWriteOptions ($ options );
924
- $ options = $ this ->inheritTypeMap ($ options );
925
917
926
918
$ operation = new RenameCollection ($ this ->databaseName , $ this ->collectionName , $ toDatabaseName , $ toCollectionName , $ options );
927
919
928
- return $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
920
+ $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
929
921
}
930
922
931
923
/**
@@ -1127,12 +1119,8 @@ private function inheritReadPreference(array $options): array
1127
1119
return $ options ;
1128
1120
}
1129
1121
1130
- private function inheritTypeMap (array $ options, ? string $ deprecatedFunction = null ): array
1122
+ private function inheritTypeMap (array $ options ): array
1131
1123
{
1132
- if ($ deprecatedFunction !== null && isset ($ options ['typeMap ' ])) {
1133
- @trigger_error (sprintf ('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated ' , $ deprecatedFunction ), E_USER_DEPRECATED );
1134
- }
1135
-
1136
1124
// Only inherit the type map if no codec is used
1137
1125
if (! isset ($ options ['typeMap ' ]) && ! isset ($ options ['codec ' ])) {
1138
1126
$ options ['typeMap ' ] = $ this ->typeMap ;
0 commit comments