@@ -508,15 +508,13 @@ public function distinct(string $fieldName, array|object $filter = [], array $op
508
508
*
509
509
* @see DropCollection::__construct() for supported options
510
510
* @param array $options Additional options
511
- * @return array|object Command result document
512
511
* @throws UnsupportedException if options are not supported by the selected server
513
512
* @throws InvalidArgumentException for parameter/option parsing errors
514
513
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
515
514
*/
516
- public function drop (array $ options = []): array | object
515
+ public function drop (array $ options = []): void
517
516
{
518
517
$ options = $ this ->inheritWriteOptions ($ options );
519
- $ options = $ this ->inheritTypeMap ($ options , __FUNCTION__ );
520
518
521
519
$ server = select_server_for_write ($ this ->manager , $ options );
522
520
@@ -529,7 +527,7 @@ public function drop(array $options = []): array|object
529
527
? new DropEncryptedCollection ($ this ->databaseName , $ this ->collectionName , $ options )
530
528
: new DropCollection ($ this ->databaseName , $ this ->collectionName , $ options );
531
529
532
- return $ operation ->execute ($ server );
530
+ $ operation ->execute ($ server );
533
531
}
534
532
535
533
/**
@@ -538,12 +536,11 @@ public function drop(array $options = []): array|object
538
536
* @see DropIndexes::__construct() for supported options
539
537
* @param string|IndexInfo $indexName Index name or model object
540
538
* @param array $options Additional options
541
- * @return array|object Command result document
542
539
* @throws UnsupportedException if options are not supported by the selected server
543
540
* @throws InvalidArgumentException for parameter/option parsing errors
544
541
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
545
542
*/
546
- public function dropIndex (string |IndexInfo $ indexName , array $ options = []): array | object
543
+ public function dropIndex (string |IndexInfo $ indexName , array $ options = []): void
547
544
{
548
545
$ indexName = (string ) $ indexName ;
549
546
@@ -552,31 +549,28 @@ public function dropIndex(string|IndexInfo $indexName, array $options = []): arr
552
549
}
553
550
554
551
$ options = $ this ->inheritWriteOptions ($ options );
555
- $ options = $ this ->inheritTypeMap ($ options , __FUNCTION__ );
556
552
557
553
$ operation = new DropIndexes ($ this ->databaseName , $ this ->collectionName , $ indexName , $ options );
558
554
559
- return $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
555
+ $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
560
556
}
561
557
562
558
/**
563
559
* Drop all indexes in the collection.
564
560
*
565
561
* @see DropIndexes::__construct() for supported options
566
562
* @param array $options Additional options
567
- * @return array|object Command result document
568
563
* @throws UnsupportedException if options are not supported by the selected server
569
564
* @throws InvalidArgumentException for parameter/option parsing errors
570
565
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
571
566
*/
572
- public function dropIndexes (array $ options = []): array | object
567
+ public function dropIndexes (array $ options = []): void
573
568
{
574
569
$ options = $ this ->inheritWriteOptions ($ options );
575
- $ options = $ this ->inheritTypeMap ($ options , __FUNCTION__ );
576
570
577
571
$ operation = new DropIndexes ($ this ->databaseName , $ this ->collectionName , '* ' , $ options );
578
572
579
- return $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
573
+ $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
580
574
}
581
575
582
576
/**
@@ -958,23 +952,21 @@ public function mapReduce(JavascriptInterface $map, JavascriptInterface $reduce,
958
952
* @param string $toCollectionName New name of the collection
959
953
* @param string|null $toDatabaseName New database name of the collection. Defaults to the original database.
960
954
* @param array $options Additional options
961
- * @return array|object Command result document
962
955
* @throws UnsupportedException if options are not supported by the selected server
963
956
* @throws InvalidArgumentException for parameter/option parsing errors
964
957
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
965
958
*/
966
- public function rename (string $ toCollectionName , ?string $ toDatabaseName = null , array $ options = []): array | object
959
+ public function rename (string $ toCollectionName , ?string $ toDatabaseName = null , array $ options = []): void
967
960
{
968
961
if (! isset ($ toDatabaseName )) {
969
962
$ toDatabaseName = $ this ->databaseName ;
970
963
}
971
964
972
965
$ options = $ this ->inheritWriteOptions ($ options );
973
- $ options = $ this ->inheritTypeMap ($ options );
974
966
975
967
$ operation = new RenameCollection ($ this ->databaseName , $ this ->collectionName , $ toDatabaseName , $ toCollectionName , $ options );
976
968
977
- return $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
969
+ $ operation ->execute (select_server_for_write ($ this ->manager , $ options ));
978
970
}
979
971
980
972
/**
@@ -1176,12 +1168,8 @@ private function inheritReadPreference(array $options): array
1176
1168
return $ options ;
1177
1169
}
1178
1170
1179
- private function inheritTypeMap (array $ options, ? string $ deprecatedFunction = null ): array
1171
+ private function inheritTypeMap (array $ options ): array
1180
1172
{
1181
- if ($ deprecatedFunction !== null && isset ($ options ['typeMap ' ])) {
1182
- @trigger_error (sprintf ('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated ' , $ deprecatedFunction ), E_USER_DEPRECATED );
1183
- }
1184
-
1185
1173
// Only inherit the type map if no codec is used
1186
1174
if (! isset ($ options ['typeMap ' ]) && ! isset ($ options ['codec ' ])) {
1187
1175
$ options ['typeMap ' ] = $ this ->typeMap ;
0 commit comments