From 4880d740bb52d6fc57cf9c208bc89972e4ca57d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Mon, 3 Nov 2025 12:47:20 -0500 Subject: [PATCH] Remove APM\Command::getServer() Use getHost and getPort instead --- src/APM/Command.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/APM/Command.php b/src/APM/Command.php index 2302d9d866..ab706afcf4 100644 --- a/src/APM/Command.php +++ b/src/APM/Command.php @@ -8,11 +8,8 @@ use MongoDB\Driver\Monitoring\CommandFailedEvent; use MongoDB\Driver\Monitoring\CommandStartedEvent; use MongoDB\Driver\Monitoring\CommandSucceededEvent; -use MongoDB\Driver\Server; use Throwable; -use function method_exists; - final class Command { private CommandStartedEvent $startedEvent; @@ -72,16 +69,6 @@ public function getRequestId(): string return $this->startedEvent->getRequestId(); } - /** @deprecated This method is failing with MongoDB Extension v2.0+, use getHost and getPort instead. */ - public function getServer(): Server - { - if (! method_exists($this->finishedEvent, 'getServer')) { - throw new LogicException('getServer() is not available in MongoDB Extension v2.0+'); - } - - return $this->finishedEvent->getServer(); - } - public function getPort(): int { return $this->finishedEvent->getPort();