Skip to content

Commit b9c3b78

Browse files
committed
Merge 'name' argument into $options for listSearchIndexes
1 parent 81dbe82 commit b9c3b78

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
@@ -1014,17 +1014,14 @@ public function listIndexes(array $options = [])
10141014
* Returns information for all Atlas Search indexes for the collection.
10151015
* Only available when used against a 7.0+ Atlas cluster.
10161016
*
1017+
* @param array{name?: string} $options Command options
10171018
* @return Iterator&Countable
10181019
* @throws InvalidArgumentException for parameter/option parsing errors
10191020
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
1020-
* @see ListSearchIndexes::__construct() for supported aggregation and list options
1021+
* @see ListSearchIndexes::__construct() for supported options
10211022
*/
1022-
public function listSearchIndexes(?string $name = null, array $options = []): Iterator
1023+
public function listSearchIndexes(array $options = []): Iterator
10231024
{
1024-
if ($name !== null) {
1025-
$options['name'] = $name;
1026-
}
1027-
10281025
$operation = new ListSearchIndexes($this->databaseName, $this->collectionName, $options);
10291026
$server = select_server($this->manager, $options);
10301027

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
@@ -568,7 +568,7 @@ private function executeForCollection(Collection $collection)
568568
return $collection->updateSearchIndex($args['name'], $args['definition']);
569569

570570
case 'listSearchIndexes':
571-
return $collection->listSearchIndexes($args['name'] ?? null, (array) ($args['aggregationOptions'] ?? []));
571+
return $collection->listSearchIndexes($args + (array) ($args['aggregationOptions'] ?? []));
572572

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

0 commit comments

Comments
 (0)