Skip to content

Commit

Permalink
Remove duplicate deprecation notices for query options
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Sep 24, 2024
1 parent 0960e1c commit fb6a9c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
11 changes: 0 additions & 11 deletions src/Operation/Find.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
use function is_string;
use function MongoDB\document_to_array;
use function MongoDB\is_document;
use function trigger_error;

use const E_USER_DEPRECATED;

/**
* Operation for the find command.
Expand Down Expand Up @@ -285,14 +282,6 @@ public function __construct(private string $databaseName, private string $collec
unset($this->options['readConcern']);
}

if (isset($this->options['snapshot'])) {
trigger_error('The "snapshot" option is deprecated and will be removed in a future release', E_USER_DEPRECATED);
}

if (isset($this->options['maxScan'])) {
trigger_error('The "maxScan" option is deprecated and will be removed in a future release', E_USER_DEPRECATED);
}

if (isset($this->options['codec']) && isset($this->options['typeMap'])) {
throw InvalidArgumentException::cannotCombineCodecAndTypeMap();
}
Expand Down
18 changes: 0 additions & 18 deletions tests/Operation/FindTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@ public static function provideInvalidConstructorOptions()
]);
}

public function testSnapshotOptionIsDeprecated(): void
{
$this->assertDeprecated(function (): void {
new Find($this->getDatabaseName(), $this->getCollectionName(), [], ['snapshot' => true]);
});

$this->assertDeprecated(function (): void {
new Find($this->getDatabaseName(), $this->getCollectionName(), [], ['snapshot' => false]);
});
}

public function testMaxScanOptionIsDeprecated(): void
{
$this->assertDeprecated(function (): void {
new Find($this->getDatabaseName(), $this->getCollectionName(), [], ['maxScan' => 1]);
});
}

/** @dataProvider provideInvalidConstructorCursorTypeOptions */
public function testConstructorCursorTypeOption($cursorType): void
{
Expand Down

0 comments on commit fb6a9c8

Please sign in to comment.