Skip to content

Commit 59a5c6e

Browse files
committed
Remove wire version checks for MongoDB 3.6
1 parent 8e4edee commit 59a5c6e

File tree

3 files changed

+0
-23
lines changed

3 files changed

+0
-23
lines changed

src/Operation/Explain.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ class Explain implements Executable
4242
public const VERBOSITY_EXEC_STATS = 'executionStats';
4343
public const VERBOSITY_QUERY = 'queryPlanner';
4444

45-
private const WIRE_VERSION_FOR_AGGREGATE = 7;
46-
4745
private string $databaseName;
4846

4947
private Explainable $explainable;
@@ -106,10 +104,6 @@ public function __construct(string $databaseName, Explainable $explainable, arra
106104
*/
107105
public function execute(Server $server)
108106
{
109-
if ($this->explainable instanceof Aggregate && ! server_supports_feature($server, self::WIRE_VERSION_FOR_AGGREGATE)) {
110-
throw UnsupportedException::explainNotSupported();
111-
}
112-
113107
$cursor = $server->executeCommand($this->databaseName, $this->createCommand(), $this->createOptions());
114108

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

src/Operation/Watch.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ class Watch implements Executable, /* @internal */ CommandSubscriber
6969
public const FULL_DOCUMENT_BEFORE_CHANGE_WHEN_AVAILABLE = 'whenAvailable';
7070
public const FULL_DOCUMENT_BEFORE_CHANGE_REQUIRED = 'required';
7171

72-
private const WIRE_VERSION_FOR_START_AT_OPERATION_TIME = 7;
73-
7472
private Aggregate $aggregate;
7573

7674
private array $aggregateOptions;
@@ -470,10 +468,6 @@ private function shouldCaptureOperationTime(Server $server): bool
470468
return false;
471469
}
472470

473-
if (! server_supports_feature($server, self::WIRE_VERSION_FOR_START_AT_OPERATION_TIME)) {
474-
return false;
475-
}
476-
477471
return true;
478472
}
479473
}

tests/Operation/WatchFunctionalTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class WatchFunctionalTest extends FunctionalTestCase
4646
public const INTERRUPTED = 11601;
4747
public const NOT_PRIMARY = 10107;
4848

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

5351
public function setUp(): void
@@ -340,10 +338,6 @@ private function assertResumeAfter($expectedResumeToken, stdClass $command): voi
340338
*/
341339
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime(): void
342340
{
343-
if (! $this->isStartAtOperationTimeSupported()) {
344-
$this->markTestSkipped('startAtOperationTime is not supported');
345-
}
346-
347341
$this->skipIfServerVersion('>=', '4.0.7', 'postBatchResumeToken takes precedence over startAtOperationTime');
348342

349343
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], $this->defaultOptions);
@@ -1653,11 +1647,6 @@ private function insertDocument($document): void
16531647
$this->assertEquals(1, $writeResult->getInsertedCount());
16541648
}
16551649

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

0 commit comments

Comments
 (0)