Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use MongoDB\Exception\UnsupportedException;
use MongoDB\Model\BSONArray;
use MongoDB\Model\BSONDocument;
use MongoDB\Model\DatabaseInfoIterator;
use MongoDB\Operation\DropDatabase;
use MongoDB\Operation\ListDatabaseNames;
use MongoDB\Operation\ListDatabases;
Expand Down Expand Up @@ -294,7 +293,7 @@ public function listDatabaseNames(array $options = []): Iterator
* List databases.
*
* @see ListDatabases::__construct() for supported options
* @return DatabaseInfoIterator
* @return Iterator
* @throws UnexpectedValueException if the command response was malformed
* @throws InvalidArgumentException for parameter/option parsing errors
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
Expand Down
3 changes: 1 addition & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use MongoDB\Model\BSONArray;
use MongoDB\Model\BSONDocument;
use MongoDB\Model\IndexInfo;
use MongoDB\Model\IndexInfoIterator;
use MongoDB\Operation\Aggregate;
use MongoDB\Operation\BulkWrite;
use MongoDB\Operation\Count;
Expand Down Expand Up @@ -882,7 +881,7 @@ public function insertOne($document, array $options = [])
* Returns information for all indexes for the collection.
*
* @see ListIndexes::__construct() for supported options
* @return IndexInfoIterator
* @return Iterator
* @throws InvalidArgumentException for parameter/option parsing errors
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
Expand Down
3 changes: 1 addition & 2 deletions src/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use MongoDB\GridFS\Bucket;
use MongoDB\Model\BSONArray;
use MongoDB\Model\BSONDocument;
use MongoDB\Model\CollectionInfoIterator;
use MongoDB\Operation\Aggregate;
use MongoDB\Operation\CreateCollection;
use MongoDB\Operation\CreateEncryptedCollection;
Expand Down Expand Up @@ -473,7 +472,7 @@ public function listCollectionNames(array $options = []): Iterator
* Returns information for all collections in this database.
*
* @see ListCollections::__construct() for supported options
* @return CollectionInfoIterator
* @return Iterator
* @throws InvalidArgumentException for parameter/option parsing errors
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
Expand Down
1 change: 1 addition & 0 deletions src/Model/CollectionInfoCommandIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
* @see \MongoDB\Database::listCollections()
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst
* @see https://mongodb.com/docs/manual/reference/command/listCollections/
* @deprecated
* @template-extends IteratorIterator<int, array, Traversable<int, array>>
*/
class CollectionInfoCommandIterator extends IteratorIterator implements CollectionInfoIterator

Check failure on line 36 in src/Model/CollectionInfoCommandIterator.php

View workflow job for this annotation

GitHub Actions / Psalm

DeprecatedInterface

src/Model/CollectionInfoCommandIterator.php:36:7: DeprecatedInterface: MongoDB\Model\CollectionInfoIterator is marked deprecated (see https://psalm.dev/152)
{
private ?string $databaseName = null;

Expand Down
1 change: 1 addition & 0 deletions src/Model/CollectionInfoIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* This iterator is used for enumerating collections in a database.
*
* @see \MongoDB\Database::listCollections()
* @deprecated
* @template-extends Iterator<int, CollectionInfo>
*/
interface CollectionInfoIterator extends Iterator
Expand Down
1 change: 1 addition & 0 deletions src/Model/DatabaseInfoIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* This iterator is used for enumerating databases on a server.
*
* @see \MongoDB\Client::listDatabases()
* @deprecated
* @template-extends Iterator<int, DatabaseInfo>
*/
interface DatabaseInfoIterator extends Iterator
Expand Down
1 change: 1 addition & 0 deletions src/Model/DatabaseInfoLegacyIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
* @internal
* @see \MongoDB\Client::listDatabases()
* @see https://mongodb.com/docs/manual/reference/command/listDatabases/
* @deprecated
*/
class DatabaseInfoLegacyIterator implements DatabaseInfoIterator

Check failure on line 36 in src/Model/DatabaseInfoLegacyIterator.php

View workflow job for this annotation

GitHub Actions / Psalm

DeprecatedInterface

src/Model/DatabaseInfoLegacyIterator.php:36:7: DeprecatedInterface: MongoDB\Model\DatabaseInfoIterator is marked deprecated (see https://psalm.dev/152)
{
private array $databases;

Expand Down
6 changes: 5 additions & 1 deletion src/Model/IndexInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ public function getName()
/**
* Return the index namespace (e.g. "db.collection").
*
* @deprecated
*
* @return string
*/
public function getNamespace()
{
@trigger_error('MongoDB 4.4 drops support for the namespace in indexes, the method "IndexInfo::getNamespace()" will be removed in a future release', E_USER_DEPRECATED);

return (string) $this->info['ns'];
}

Expand Down Expand Up @@ -131,7 +135,7 @@ public function is2dSphere()
*/
public function isGeoHaystack()
{
trigger_error('MongoDB 5.0 removes support for "geoHaystack" indexes, the method "IndexInfo::isGeoHaystack()" will be removed in a future release', E_USER_DEPRECATED);
@trigger_error('MongoDB 5.0 removes support for "geoHaystack" indexes, the method "IndexInfo::isGeoHaystack()" will be removed in a future release', E_USER_DEPRECATED);

return array_search('geoHaystack', $this->getKey(), true) !== false;
}
Expand Down
1 change: 1 addition & 0 deletions src/Model/IndexInfoIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* This iterator is used for enumerating indexes in a collection.
*
* @see \MongoDB\Collection::listIndexes()
* @deprecated
* @template-extends Iterator<int, IndexInfo>
*/
interface IndexInfoIterator extends Iterator
Expand Down
1 change: 1 addition & 0 deletions src/Model/IndexInfoIteratorIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst
* @see https://mongodb.com/docs/manual/reference/command/listIndexes/
* @see https://mongodb.com/docs/manual/reference/system-collections/
* @deprecated
* @template-extends IteratorIterator<int, array, Traversable<int, array>>
*/
class IndexInfoIteratorIterator extends IteratorIterator implements IndexInfoIterator

Check failure on line 40 in src/Model/IndexInfoIteratorIterator.php

View workflow job for this annotation

GitHub Actions / Psalm

DeprecatedInterface

src/Model/IndexInfoIteratorIterator.php:40:7: DeprecatedInterface: MongoDB\Model\IndexInfoIterator is marked deprecated (see https://psalm.dev/152)
{
private ?string $ns = null;

Expand Down
4 changes: 2 additions & 2 deletions src/Operation/ListCollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

namespace MongoDB\Operation;

use Iterator;
use MongoDB\Command\ListCollections as ListCollectionsCommand;
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
use MongoDB\Driver\Server;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\Model\CollectionInfoCommandIterator;
use MongoDB\Model\CollectionInfoIterator;

/**
* Operation for the listCollections command.
Expand Down Expand Up @@ -71,7 +71,7 @@ public function __construct(string $databaseName, array $options = [])
* Execute the operation.
*
* @see Executable::execute()
* @return CollectionInfoIterator
* @return Iterator
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
public function execute(Server $server)
Expand Down
4 changes: 2 additions & 2 deletions src/Operation/ListDatabases.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

namespace MongoDB\Operation;

use Iterator;
use MongoDB\Command\ListDatabases as ListDatabasesCommand;
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
use MongoDB\Driver\Server;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\Exception\UnexpectedValueException;
use MongoDB\Model\DatabaseInfoIterator;
use MongoDB\Model\DatabaseInfoLegacyIterator;

/**
Expand Down Expand Up @@ -68,7 +68,7 @@ public function __construct(array $options = [])
* Execute the operation.
*
* @see Executable::execute()
* @return DatabaseInfoIterator
* @return Iterator
* @throws UnexpectedValueException if the command response was malformed
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Operation/ListIndexes.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
namespace MongoDB\Operation;

use EmptyIterator;
use Iterator;
use MongoDB\Driver\Command;
use MongoDB\Driver\Exception\CommandException;
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
use MongoDB\Driver\Server;
use MongoDB\Driver\Session;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\Model\CachingIterator;
use MongoDB\Model\IndexInfoIterator;
use MongoDB\Model\IndexInfoIteratorIterator;

use function is_integer;
Expand Down Expand Up @@ -85,7 +85,7 @@ public function __construct(string $databaseName, string $collectionName, array
* Execute the operation.
*
* @see Executable::execute()
* @return IndexInfoIterator
* @return Iterator
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
public function execute(Server $server)
Expand Down
Loading