Skip to content

Commit 781cc7c

Browse files
committed
Remove return type from Executable interface
1 parent 196075b commit 781cc7c

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/Operation/DropSearchIndex.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,11 @@ public function __construct(private string $databaseName, private string $collec
5353
/**
5454
* Execute the operation.
5555
*
56-
* TODO PHP 8.2: Change return type to null
57-
*
5856
* @see Executable::execute()
5957
* @throws UnsupportedException if write concern is used and unsupported
6058
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
61-
* @return null
6259
*/
63-
public function execute(Server $server): mixed
60+
public function execute(Server $server): void
6461
{
6562
$cmd = [
6663
'dropSearchIndex' => $this->collectionName,
@@ -79,7 +76,5 @@ public function execute(Server $server): mixed
7976
throw $e;
8077
}
8178
}
82-
83-
return null;
8479
}
8580
}

src/Operation/Executable.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ interface Executable
3131
{
3232
/**
3333
* Execute the operation.
34+
*
35+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
36+
* @return mixed|void
3437
*/
35-
public function execute(Server $server): mixed;
38+
public function execute(Server $server);
3639
}

src/Operation/UpdateSearchIndex.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
namespace MongoDB\Operation;
1919

2020
use MongoDB\Driver\Command;
21-
use MongoDB\Driver\Cursor;
2221
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
2322
use MongoDB\Driver\Server;
2423
use MongoDB\Exception\InvalidArgumentException;
@@ -66,7 +65,7 @@ public function __construct(private string $databaseName, private string $collec
6665
* @throws UnsupportedException if write concern is used and unsupported
6766
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
6867
*/
69-
public function execute(Server $server): Cursor
68+
public function execute(Server $server): void
7069
{
7170
$cmd = [
7271
'updateSearchIndex' => $this->collectionName,
@@ -78,6 +77,6 @@ public function execute(Server $server): Cursor
7877
$cmd['comment'] = $this->options['comment'];
7978
}
8079

81-
return $server->executeCommand($this->databaseName, new Command($cmd));
80+
$server->executeCommand($this->databaseName, new Command($cmd));
8281
}
8382
}

0 commit comments

Comments
 (0)