Skip to content

Commit 9bd1347

Browse files
committed
PHPLIB-1517: Remove Executable interface
1 parent c7728da commit 9bd1347

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+47
-136
lines changed

UPGRADE-2.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ UPGRADE FROM 1.x to 2.0
99
* The `MongoDB\Model\IndexInfo::isGeoHaystack` method has been removed.
1010
* The `maxScan`, `modifiers`, `oplogReplay`, and `snapshot` options for `find`
1111
and `findOne` operations have been removed.
12+
* The `MongoDB\Operation\Executable` interface has been removed.
1213

1314
GridFS
1415
------

src/Command/ListCollections.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use MongoDB\Driver\Session;
2525
use MongoDB\Exception\InvalidArgumentException;
2626
use MongoDB\Model\CachingIterator;
27-
use MongoDB\Operation\Executable;
2827

2928
use function is_bool;
3029
use function is_integer;
@@ -36,7 +35,7 @@
3635
* @internal
3736
* @see https://mongodb.com/docs/manual/reference/command/listCollections/
3837
*/
39-
final class ListCollections implements Executable
38+
final class ListCollections
4039
{
4140
/**
4241
* Constructs a listCollections command.
@@ -94,7 +93,6 @@ public function __construct(private string $databaseName, private array $options
9493
* Execute the operation.
9594
*
9695
* @return CachingIterator<int, array>
97-
* @see Executable::execute()
9896
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
9997
*/
10098
public function execute(Server $server): CachingIterator

src/Command/ListDatabases.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use MongoDB\Driver\Session;
2424
use MongoDB\Exception\InvalidArgumentException;
2525
use MongoDB\Exception\UnexpectedValueException;
26-
use MongoDB\Operation\Executable;
2726

2827
use function current;
2928
use function is_array;
@@ -37,7 +36,7 @@
3736
* @internal
3837
* @see https://mongodb.com/docs/manual/reference/command/listDatabases/
3938
*/
40-
final class ListDatabases implements Executable
39+
final class ListDatabases
4140
{
4241
/**
4342
* Constructs a listDatabases command.
@@ -93,7 +92,6 @@ public function __construct(private array $options = [])
9392
/**
9493
* Execute the operation.
9594
*
96-
* @see Executable::execute()
9795
* @return array An array of database info structures
9896
* @throws UnexpectedValueException if the command response was malformed
9997
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/Aggregate.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* @see \MongoDB\Collection::aggregate()
4848
* @see https://mongodb.com/docs/manual/reference/command/aggregate/
4949
*/
50-
final class Aggregate implements Executable, Explainable
50+
final class Aggregate implements Explainable
5151
{
5252
private bool $isWrite;
5353

@@ -212,7 +212,6 @@ public function __construct(private string $databaseName, private ?string $colle
212212
/**
213213
* Execute the operation.
214214
*
215-
* @see Executable::execute()
216215
* @throws UnexpectedValueException if the command response was malformed
217216
* @throws UnsupportedException if read concern or write concern is used and unsupported
218217
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/BulkWrite.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*
4747
* @see \MongoDB\Collection::bulkWrite()
4848
*/
49-
final class BulkWrite implements Executable
49+
final class BulkWrite
5050
{
5151
public const DELETE_MANY = 'deleteMany';
5252
public const DELETE_ONE = 'deleteOne';
@@ -185,7 +185,6 @@ public function __construct(private string $databaseName, private string $collec
185185
/**
186186
* Execute the operation.
187187
*
188-
* @see Executable::execute()
189188
* @throws UnsupportedException if write concern is used and unsupported
190189
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
191190
*/

src/Operation/Count.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* @see \MongoDB\Collection::count()
4242
* @see https://mongodb.com/docs/manual/reference/command/count/
4343
*/
44-
final class Count implements Executable, Explainable
44+
final class Count implements Explainable
4545
{
4646
/**
4747
* Constructs a count command.
@@ -124,7 +124,6 @@ public function __construct(private string $databaseName, private string $collec
124124
/**
125125
* Execute the operation.
126126
*
127-
* @see Executable::execute()
128127
* @throws UnexpectedValueException if the command response was malformed
129128
* @throws UnsupportedException if read concern is used and unsupported
130129
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/CountDocuments.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @see \MongoDB\Collection::countDocuments()
3838
* @see https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#countdocuments
3939
*/
40-
final class CountDocuments implements Executable
40+
final class CountDocuments
4141
{
4242
private array $aggregateOptions;
4343

@@ -103,7 +103,6 @@ public function __construct(private string $databaseName, private string $collec
103103
/**
104104
* Execute the operation.
105105
*
106-
* @see Executable::execute()
107106
* @throws UnexpectedValueException if the command response was malformed
108107
* @throws UnsupportedException if collation or read concern is used and unsupported
109108
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/CreateCollection.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* @see \MongoDB\Database::createCollection()
4242
* @see https://mongodb.com/docs/manual/reference/command/create/
4343
*/
44-
final class CreateCollection implements Executable
44+
final class CreateCollection
4545
{
4646
public const USE_POWER_OF_2_SIZES = 1;
4747
public const NO_PADDING = 2;
@@ -239,7 +239,6 @@ public function __construct(private string $databaseName, private string $collec
239239
/**
240240
* Execute the operation.
241241
*
242-
* @see Executable::execute()
243242
* @return array|object Command result document
244243
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
245244
*/

src/Operation/CreateEncryptedCollection.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#create-encrypted-collection-helper
4949
* @see https://www.mongodb.com/docs/manual/core/queryable-encryption/fundamentals/manage-collections/
5050
*/
51-
final class CreateEncryptedCollection implements Executable
51+
final class CreateEncryptedCollection
5252
{
5353
private const WIRE_VERSION_FOR_QUERYABLE_ENCRYPTION_V2 = 21;
5454

@@ -155,7 +155,6 @@ public function createDataKeys(ClientEncryption $clientEncryption, string $kmsPr
155155
}
156156

157157
/**
158-
* @see Executable::execute()
159158
* @return array|object Command result document from creating the encrypted collection
160159
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
161160
* @throws UnsupportedException if the server does not support Queryable Encryption

src/Operation/CreateIndexes.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* @see \MongoDB\Collection::createIndexes()
4242
* @see https://mongodb.com/docs/manual/reference/command/createIndexes/
4343
*/
44-
final class CreateIndexes implements Executable
44+
final class CreateIndexes
4545
{
4646
private const WIRE_VERSION_FOR_COMMIT_QUORUM = 9;
4747

@@ -116,7 +116,6 @@ public function __construct(private string $databaseName, private string $collec
116116
/**
117117
* Execute the operation.
118118
*
119-
* @see Executable::execute()
120119
* @return string[] The names of the created indexes
121120
* @throws UnsupportedException if write concern is used and unsupported
122121
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/CreateSearchIndexes.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @see \MongoDB\Collection::createSearchIndexes()
3838
* @see https://mongodb.com/docs/manual/reference/command/createSearchIndexes/
3939
*/
40-
final class CreateSearchIndexes implements Executable
40+
final class CreateSearchIndexes
4141
{
4242
private array $indexes = [];
4343

@@ -68,7 +68,6 @@ public function __construct(private string $databaseName, private string $collec
6868
/**
6969
* Execute the operation.
7070
*
71-
* @see Executable::execute()
7271
* @return string[] The names of the created indexes
7372
* @throws UnsupportedException if write concern is used and unsupported
7473
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/DatabaseCommand.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*
3333
* @see \MongoDB\Database::command()
3434
*/
35-
final class DatabaseCommand implements Executable
35+
final class DatabaseCommand
3636
{
3737
private Command $command;
3838

@@ -78,11 +78,6 @@ public function __construct(private string $databaseName, array|object $command,
7878
$this->command = $command instanceof Command ? $command : new Command($command);
7979
}
8080

81-
/**
82-
* Execute the operation.
83-
*
84-
* @see Executable::execute()
85-
*/
8681
public function execute(Server $server): CursorInterface
8782
{
8883
$cursor = $server->executeCommand($this->databaseName, $this->command, $this->createOptions());

src/Operation/Delete.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* @internal
4343
* @see https://mongodb.com/docs/manual/reference/command/delete/
4444
*/
45-
final class Delete implements Executable, Explainable
45+
final class Delete implements Explainable
4646
{
4747
private const WIRE_VERSION_FOR_HINT = 9;
4848

@@ -120,7 +120,6 @@ public function __construct(private string $databaseName, private string $collec
120120
/**
121121
* Execute the operation.
122122
*
123-
* @see Executable::execute()
124123
* @throws UnsupportedException if hint or write concern is used and unsupported
125124
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
126125
*/

src/Operation/DeleteMany.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @see \MongoDB\Collection::deleteOne()
3030
* @see https://mongodb.com/docs/manual/reference/command/delete/
3131
*/
32-
final class DeleteMany implements Executable, Explainable
32+
final class DeleteMany implements Explainable
3333
{
3434
private Delete $delete;
3535

@@ -74,7 +74,6 @@ public function __construct(string $databaseName, string $collectionName, array|
7474
/**
7575
* Execute the operation.
7676
*
77-
* @see Executable::execute()
7877
* @throws UnsupportedException if collation is used and unsupported
7978
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
8079
*/

src/Operation/DeleteOne.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @see \MongoDB\Collection::deleteOne()
3030
* @see https://mongodb.com/docs/manual/reference/command/delete/
3131
*/
32-
final class DeleteOne implements Executable, Explainable
32+
final class DeleteOne implements Explainable
3333
{
3434
private Delete $delete;
3535

@@ -74,7 +74,6 @@ public function __construct(string $databaseName, string $collectionName, array|
7474
/**
7575
* Execute the operation.
7676
*
77-
* @see Executable::execute()
7877
* @throws UnsupportedException if collation is used and unsupported
7978
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
8079
*/

src/Operation/Distinct.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @see \MongoDB\Collection::distinct()
4141
* @see https://mongodb.com/docs/manual/reference/command/distinct/
4242
*/
43-
final class Distinct implements Executable, Explainable
43+
final class Distinct implements Explainable
4444
{
4545
/**
4646
* Constructs a distinct command.
@@ -109,7 +109,6 @@ public function __construct(private string $databaseName, private string $collec
109109
/**
110110
* Execute the operation.
111111
*
112-
* @see Executable::execute()
113112
* @throws UnexpectedValueException if the command response was malformed
114113
* @throws UnsupportedException if read concern is used and unsupported
115114
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/DropCollection.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* @see \MongoDB\Database::dropCollection()
3737
* @see https://mongodb.com/docs/manual/reference/command/drop/
3838
*/
39-
final class DropCollection implements Executable
39+
final class DropCollection
4040
{
4141
private const ERROR_CODE_NAMESPACE_NOT_FOUND = 26;
4242

@@ -83,7 +83,6 @@ public function __construct(private string $databaseName, private string $collec
8383
/**
8484
* Execute the operation.
8585
*
86-
* @see Executable::execute()
8786
* @return array|object Command result document
8887
* @throws UnsupportedException if write concern is used and unsupported
8988
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/DropDatabase.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @see \MongoDB\Database::drop()
3535
* @see https://mongodb.com/docs/manual/reference/command/dropDatabase/
3636
*/
37-
final class DropDatabase implements Executable
37+
final class DropDatabase
3838
{
3939
/**
4040
* Constructs a dropDatabase command.
@@ -78,7 +78,6 @@ public function __construct(private string $databaseName, private array $options
7878
/**
7979
* Execute the operation.
8080
*
81-
* @see Executable::execute()
8281
* @return array|object Command result document
8382
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
8483
*/

src/Operation/DropEncryptedCollection.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#drop-collection-helper
3838
* @see https://www.mongodb.com/docs/manual/core/queryable-encryption/fundamentals/manage-collections/
3939
*/
40-
final class DropEncryptedCollection implements Executable
40+
final class DropEncryptedCollection
4141
{
4242
private DropCollection $dropCollection;
4343

@@ -85,7 +85,6 @@ public function __construct(string $databaseName, string $collectionName, array
8585
}
8686

8787
/**
88-
* @see Executable::execute()
8988
* @return array|object Command result document from dropping the encrypted collection
9089
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
9190
*/

src/Operation/DropIndexes.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* @see \MongoDB\Collection::dropIndexes()
3636
* @see https://mongodb.com/docs/manual/reference/command/dropIndexes/
3737
*/
38-
final class DropIndexes implements Executable
38+
final class DropIndexes
3939
{
4040
/**
4141
* Constructs a dropIndexes command.
@@ -92,7 +92,6 @@ public function __construct(private string $databaseName, private string $collec
9292
/**
9393
* Execute the operation.
9494
*
95-
* @see Executable::execute()
9695
* @return array|object Command result document
9796
* @throws UnsupportedException if write concern is used and unsupported
9897
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

src/Operation/DropSearchIndex.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @see \MongoDB\Collection::dropSearchIndexes()
3131
* @see https://mongodb.com/docs/manual/reference/command/dropSearchIndexes/
3232
*/
33-
final class DropSearchIndex implements Executable
33+
final class DropSearchIndex
3434
{
3535
private const ERROR_CODE_NAMESPACE_NOT_FOUND = 26;
3636

@@ -53,7 +53,6 @@ public function __construct(private string $databaseName, private string $collec
5353
/**
5454
* Execute the operation.
5555
*
56-
* @see Executable::execute()
5756
* @throws UnsupportedException if write concern is used and unsupported
5857
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
5958
*/

src/Operation/EstimatedDocumentCount.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* @see \MongoDB\Collection::estimatedDocumentCount()
3636
* @see https://mongodb.com/docs/manual/reference/command/count/
3737
*/
38-
final class EstimatedDocumentCount implements Executable, Explainable
38+
final class EstimatedDocumentCount implements Explainable
3939
{
4040
private array $options;
4141

@@ -87,7 +87,6 @@ public function __construct(private string $databaseName, private string $collec
8787
/**
8888
* Execute the operation.
8989
*
90-
* @see Executable::execute()
9190
* @throws UnexpectedValueException if the command response was malformed
9291
* @throws UnsupportedException if collation or read concern is used and unsupported
9392
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)

0 commit comments

Comments
 (0)