Skip to content

Commit 0e6f721

Browse files
committed
Remove wire version checks for MongoDB 3.6
1 parent 8e4edee commit 0e6f721

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

src/Operation/Explain.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use function current;
2929
use function is_array;
3030
use function is_string;
31-
use function MongoDB\server_supports_feature;
3231

3332
/**
3433
* Operation for the explain command.
@@ -42,8 +41,6 @@ class Explain implements Executable
4241
public const VERBOSITY_EXEC_STATS = 'executionStats';
4342
public const VERBOSITY_QUERY = 'queryPlanner';
4443

45-
private const WIRE_VERSION_FOR_AGGREGATE = 7;
46-
4744
private string $databaseName;
4845

4946
private Explainable $explainable;
@@ -106,10 +103,6 @@ public function __construct(string $databaseName, Explainable $explainable, arra
106103
*/
107104
public function execute(Server $server)
108105
{
109-
if ($this->explainable instanceof Aggregate && ! server_supports_feature($server, self::WIRE_VERSION_FOR_AGGREGATE)) {
110-
throw UnsupportedException::explainNotSupported();
111-
}
112-
113106
$cursor = $server->executeCommand($this->databaseName, $this->createCommand(), $this->createOptions());
114107

115108
if (isset($this->options['typeMap'])) {

src/Operation/Watch.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
use function MongoDB\Driver\Monitoring\removeSubscriber;
4848
use function MongoDB\is_document;
4949
use function MongoDB\select_server;
50-
use function MongoDB\server_supports_feature;
5150

5251
/**
5352
* Operation for creating a change stream with the aggregate command.
@@ -69,8 +68,6 @@ class Watch implements Executable, /* @internal */ CommandSubscriber
6968
public const FULL_DOCUMENT_BEFORE_CHANGE_WHEN_AVAILABLE = 'whenAvailable';
7069
public const FULL_DOCUMENT_BEFORE_CHANGE_REQUIRED = 'required';
7170

72-
private const WIRE_VERSION_FOR_START_AT_OPERATION_TIME = 7;
73-
7471
private Aggregate $aggregate;
7572

7673
private array $aggregateOptions;
@@ -470,10 +467,6 @@ private function shouldCaptureOperationTime(Server $server): bool
470467
return false;
471468
}
472469

473-
if (! server_supports_feature($server, self::WIRE_VERSION_FOR_START_AT_OPERATION_TIME)) {
474-
return false;
475-
}
476-
477470
return true;
478471
}
479472
}

tests/Operation/WatchFunctionalTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
use function assert;
3434
use function bin2hex;
3535
use function microtime;
36-
use function MongoDB\server_supports_feature;
3736
use function sprintf;
3837

3938
/**
@@ -46,8 +45,6 @@ class WatchFunctionalTest extends FunctionalTestCase
4645
public const INTERRUPTED = 11601;
4746
public const NOT_PRIMARY = 10107;
4847

49-
private static int $wireVersionForStartAtOperationTime = 7;
50-
5148
private array $defaultOptions = ['maxAwaitTimeMS' => 500];
5249

5350
public function setUp(): void
@@ -340,10 +337,6 @@ private function assertResumeAfter($expectedResumeToken, stdClass $command): voi
340337
*/
341338
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime(): void
342339
{
343-
if (! $this->isStartAtOperationTimeSupported()) {
344-
$this->markTestSkipped('startAtOperationTime is not supported');
345-
}
346-
347340
$this->skipIfServerVersion('>=', '4.0.7', 'postBatchResumeToken takes precedence over startAtOperationTime');
348341

349342
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], $this->defaultOptions);
@@ -1653,11 +1646,6 @@ private function insertDocument($document): void
16531646
$this->assertEquals(1, $writeResult->getInsertedCount());
16541647
}
16551648

1656-
private function isStartAtOperationTimeSupported()
1657-
{
1658-
return server_supports_feature($this->getPrimaryServer(), self::$wireVersionForStartAtOperationTime);
1659-
}
1660-
16611649
private function advanceCursorUntilValid(Iterator $iterator, $limitOnShardedClusters = 10): void
16621650
{
16631651
if (! $this->isShardedCluster()) {

0 commit comments

Comments
 (0)