Skip to content

Commit 9f5b441

Browse files
committed
Remove usages of info iterator interfaces in return types
1 parent f415a59 commit 9f5b441

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

src/Client.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
use MongoDB\Exception\UnsupportedException;
3434
use MongoDB\Model\BSONArray;
3535
use MongoDB\Model\BSONDocument;
36-
use MongoDB\Model\DatabaseInfoIterator;
3736
use MongoDB\Operation\DropDatabase;
3837
use MongoDB\Operation\ListDatabaseNames;
3938
use MongoDB\Operation\ListDatabases;
@@ -294,7 +293,7 @@ public function listDatabaseNames(array $options = []): Iterator
294293
* List databases.
295294
*
296295
* @see ListDatabases::__construct() for supported options
297-
* @return DatabaseInfoIterator
296+
* @return Iterator
298297
* @throws UnexpectedValueException if the command response was malformed
299298
* @throws InvalidArgumentException for parameter/option parsing errors
300299
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Collection.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
use MongoDB\Model\BSONArray;
3434
use MongoDB\Model\BSONDocument;
3535
use MongoDB\Model\IndexInfo;
36-
use MongoDB\Model\IndexInfoIterator;
3736
use MongoDB\Operation\Aggregate;
3837
use MongoDB\Operation\BulkWrite;
3938
use MongoDB\Operation\Count;
@@ -882,7 +881,7 @@ public function insertOne($document, array $options = [])
882881
* Returns information for all indexes for the collection.
883882
*
884883
* @see ListIndexes::__construct() for supported options
885-
* @return IndexInfoIterator
884+
* @return Iterator
886885
* @throws InvalidArgumentException for parameter/option parsing errors
887886
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
888887
*/

src/Database.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use MongoDB\GridFS\Bucket;
3333
use MongoDB\Model\BSONArray;
3434
use MongoDB\Model\BSONDocument;
35-
use MongoDB\Model\CollectionInfoIterator;
3635
use MongoDB\Operation\Aggregate;
3736
use MongoDB\Operation\CreateCollection;
3837
use MongoDB\Operation\CreateEncryptedCollection;
@@ -473,7 +472,7 @@ public function listCollectionNames(array $options = []): Iterator
473472
* Returns information for all collections in this database.
474473
*
475474
* @see ListCollections::__construct() for supported options
476-
* @return CollectionInfoIterator
475+
* @return Iterator
477476
* @throws InvalidArgumentException for parameter/option parsing errors
478477
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
479478
*/

src/Operation/ListCollections.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
namespace MongoDB\Operation;
1919

20+
use Iterator;
2021
use MongoDB\Command\ListCollections as ListCollectionsCommand;
2122
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
2223
use MongoDB\Driver\Server;
2324
use MongoDB\Exception\InvalidArgumentException;
2425
use MongoDB\Model\CollectionInfoCommandIterator;
25-
use MongoDB\Model\CollectionInfoIterator;
2626

2727
/**
2828
* Operation for the listCollections command.
@@ -71,7 +71,7 @@ public function __construct(string $databaseName, array $options = [])
7171
* Execute the operation.
7272
*
7373
* @see Executable::execute()
74-
* @return CollectionInfoIterator
74+
* @return Iterator
7575
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
7676
*/
7777
public function execute(Server $server)

src/Operation/ListDatabases.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
namespace MongoDB\Operation;
1919

20+
use Iterator;
2021
use MongoDB\Command\ListDatabases as ListDatabasesCommand;
2122
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
2223
use MongoDB\Driver\Server;
2324
use MongoDB\Exception\InvalidArgumentException;
2425
use MongoDB\Exception\UnexpectedValueException;
25-
use MongoDB\Model\DatabaseInfoIterator;
2626
use MongoDB\Model\DatabaseInfoLegacyIterator;
2727

2828
/**
@@ -68,7 +68,7 @@ public function __construct(array $options = [])
6868
* Execute the operation.
6969
*
7070
* @see Executable::execute()
71-
* @return DatabaseInfoIterator
71+
* @return Iterator
7272
* @throws UnexpectedValueException if the command response was malformed
7373
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
7474
*/

src/Operation/ListIndexes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
namespace MongoDB\Operation;
1919

2020
use EmptyIterator;
21+
use Iterator;
2122
use MongoDB\Driver\Command;
2223
use MongoDB\Driver\Exception\CommandException;
2324
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
2425
use MongoDB\Driver\Server;
2526
use MongoDB\Driver\Session;
2627
use MongoDB\Exception\InvalidArgumentException;
2728
use MongoDB\Model\CachingIterator;
28-
use MongoDB\Model\IndexInfoIterator;
2929
use MongoDB\Model\IndexInfoIteratorIterator;
3030

3131
use function is_integer;
@@ -85,7 +85,7 @@ public function __construct(string $databaseName, string $collectionName, array
8585
* Execute the operation.
8686
*
8787
* @see Executable::execute()
88-
* @return IndexInfoIterator
88+
* @return Iterator
8989
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
9090
*/
9191
public function execute(Server $server)

0 commit comments

Comments
 (0)