Skip to content

Commit 1627399

Browse files
committed
Merge 'name' argument into $options for listSearchIndexes
1 parent 4ccc852 commit 1627399

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/Collection.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,17 +1027,14 @@ public function listIndexes(array $options = [])
10271027
* Returns information for all Atlas Search indexes for the collection.
10281028
* Only available when used against a 7.0+ Atlas cluster.
10291029
*
1030+
* @param array{name?: string} $options Command options
10301031
* @return Iterator&Countable
10311032
* @throws InvalidArgumentException for parameter/option parsing errors
10321033
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
1033-
* @see ListSearchIndexes::__construct() for supported aggregation and list options
1034+
* @see ListSearchIndexes::__construct() for supported options
10341035
*/
1035-
public function listSearchIndexes(?string $name = null, array $options = []): Iterator
1036+
public function listSearchIndexes(array $options = []): Iterator
10361037
{
1037-
if ($name !== null) {
1038-
$options['name'] = $name;
1039-
}
1040-
10411038
$operation = new ListSearchIndexes($this->databaseName, $this->collectionName, $options);
10421039
$server = select_server($this->manager, $options);
10431040

src/Operation/ListSearchIndexes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ class ListSearchIndexes implements Executable
5555
/**
5656
* Constructs an aggregate command for listing Atlas Search indexes
5757
*
58-
* @param string $databaseName Database name
59-
* @param string $collectionName Collection name
60-
* @param array $options Command options
58+
* @param string $databaseName Database name
59+
* @param string $collectionName Collection name
60+
* @param array{name?: string} $options Command options
6161
*/
6262
public function __construct(string $databaseName, string $collectionName, array $options = [])
6363
{

tests/UnifiedSpecTests/Operation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ function (IndexInfo $info) {
584584
return $collection->updateSearchIndex($args['name'], $args['definition']);
585585

586586
case 'listSearchIndexes':
587-
return $collection->listSearchIndexes($args['name'] ?? null, (array) ($args['aggregationOptions'] ?? []));
587+
return $collection->listSearchIndexes($args + (array) ($args['aggregationOptions'] ?? []));
588588

589589
default:
590590
Assert::fail('Unsupported collection operation: ' . $this->name);

0 commit comments

Comments
 (0)