Skip to content

Commit 7adcc67

Browse files
committed
Fix psalm error
1 parent 3b3deb8 commit 7adcc67

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Operation/DropSearchIndex.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ public function __construct(private string $databaseName, private string $collec
5454
/**
5555
* Execute the operation.
5656
*
57+
* TODO PHP 8.2: Change return type to null
5758
* @see Executable::execute()
5859
* @throws UnsupportedException if write concern is used and unsupported
5960
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
61+
* @return null
6062
*/
61-
public function execute(Server $server): Cursor
63+
public function execute(Server $server): mixed
6264
{
6365
$cmd = [
6466
'dropSearchIndex' => $this->collectionName,
@@ -70,12 +72,14 @@ public function execute(Server $server): Cursor
7072
}
7173

7274
try {
73-
return $server->executeCommand($this->databaseName, new Command($cmd));
75+
$server->executeCommand($this->databaseName, new Command($cmd));
7476
} catch (CommandException $e) {
7577
// Drop operations are idempotent. The server may return an error if the collection does not exist.
7678
if ($e->getCode() !== self::ERROR_CODE_NAMESPACE_NOT_FOUND) {
7779
throw $e;
7880
}
7981
}
82+
83+
return null;
8084
}
8185
}

0 commit comments

Comments
 (0)