Skip to content

Commit 42608f3

Browse files
committed
Simplify interface implementations with contravariance
These methods are never called, so type hints are unnecessary
1 parent 209d157 commit 42608f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/logging/logging-addSubscriber-005.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ MongoDB\Driver\Monitoring\addSubscriber(): Adding a combined CommandSubscriber a
88
require_once __DIR__ . "/../utils/basic.inc";
99

1010
use MongoDB\Driver\Command;
11+
use MongoDB\Driver\Monitoring\CommandStartedEvent;
1112
use MongoDB\Driver\Monitoring\CommandSubscriber;
1213
use MongoDB\Driver\Monitoring\LogSubscriber;
1314
use function MongoDB\Driver\Monitoring\addSubscriber;
@@ -16,14 +17,14 @@ use function MongoDB\Driver\Monitoring\removeSubscriber;
1617

1718
class MySubscriber implements CommandSubscriber, LogSubscriber
1819
{
19-
public function commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void
20+
public function commandStarted(CommandStartedEvent $event): void
2021
{
2122
printf("Observed commandStarted for %s\n", $event->getCommandName());
2223
}
2324

24-
public function commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void {}
25+
public function commandSucceeded($event): void {}
2526

26-
public function commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void {}
27+
public function commandFailed($event): void {}
2728

2829
public function log(int $level, string $domain, string $message): void
2930
{

0 commit comments

Comments
 (0)