Skip to content

Commit 69cd29c

Browse files
committed
Address code review
1 parent adbcc64 commit 69cd29c

File tree

7 files changed

+10
-5
lines changed

7 files changed

+10
-5
lines changed

UPGRADE-2.0.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ UPGRADE FROM 1.x to 2.0
66
* The `MongoDB\ChangeStream::CURSOR_NOT_FOUND` constant is now private.
77
* The `MongoDB\Operation\Watch::FULL_DOCUMENT_DEFAULT` constant has been
88
removed.
9-
* The `getNamespace` and `isGeoHaystack` methods hav been removed from the
9+
* The `getNamespace` and `isGeoHaystack` methods have been removed from the
1010
`MongoDB\Model\IndexInfo` class.
1111
* The `maxScan`, `modifiers`, `oplogReplay`, and `snapshot` options for `find`
1212
and `findOne` operations have been removed.
13-
* The `MongoDB\Collection::mapReduce` method has been removed. Use aggregation
14-
pipeline instead.
13+
* The `MongoDB\Collection::mapReduce` method has been removed. Use
14+
[aggregation pipeline](https://www.mongodb.com/docs/manual/reference/map-reduce-to-aggregation-pipeline/)
15+
instead.
1516
* The following classes and interfaces have been removed without replacement:
1617
* `MongoDB\MapReduceResult`
1718
* `MongoDB\Model\CollectionInfoCommandIterator`

src/Client.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ public function getWriteConcern(): WriteConcern
283283
* List database names.
284284
*
285285
* @see ListDatabaseNames::__construct() for supported options
286+
* @return Iterator<int, string>
286287
* @throws UnexpectedValueException if the command response was malformed
287288
* @throws InvalidArgumentException for parameter/option parsing errors
288289
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Database.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ public function getWriteConcern(): WriteConcern
459459
* Returns the names of all collections in this database
460460
*
461461
* @see ListCollectionNames::__construct() for supported options
462+
* @return Iterator<int, string>
462463
* @throws InvalidArgumentException for parameter/option parsing errors
463464
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
464465
*/

src/Operation/ListCollectionNames.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(string $databaseName, array $options = [])
6868
/**
6969
* Execute the operation.
7070
*
71-
* @return Iterator
71+
* @return Iterator<int, string>
7272
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
7373
*/
7474
public function execute(Server $server): Iterator

src/Operation/ListDatabaseNames.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function __construct(array $options = [])
6969
/**
7070
* Execute the operation.
7171
*
72+
* @return Iterator<int, string>
7273
* @throws UnexpectedValueException if the command response was malformed
7374
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
7475
*/

stubs/Driver/CursorInterface.stub.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Iterator;
66
use MongoDB\BSON\Int64;
7-
use Traversable;
87

98
/**
109
* @template TValue of array|object

tests/Operation/ListCollectionsFunctionalTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public function testIdIndexAndInfo(): void
5757
foreach ($collections as $collection) {
5858
$this->assertInstanceOf(CollectionInfo::class, $collection);
5959
$this->assertArrayHasKey('readOnly', $collection['info']);
60+
// Use assertMatchesDocument as MongoDB 4.0 and 4.2 include a ns field
61+
// TODO: change to assertEquals when dropping support for MongoDB 4.2
6062
$this->assertMatchesDocument(['v' => 2, 'key' => ['_id' => 1], 'name' => '_id_'], $collection['idIndex']);
6163
}
6264
}

0 commit comments

Comments
 (0)