From 5709537ef9cc0c90225ce73ac903c4aafbee9473 Mon Sep 17 00:00:00 2001 From: Tom Sommer Date: Fri, 9 Oct 2026 17:38:17 +0200 Subject: [PATCH] Fix Client::setProtocol() always throwing The loop stored the protocol class name instead of the given instance and then fell through to the exception after break. Store the instance and return once a matching protocol type is found. --- src/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client.php b/src/Client.php index 5c27fb1..cdf0557 100644 --- a/src/Client.php +++ b/src/Client.php @@ -211,8 +211,8 @@ public function setProtocol(RdapProtocolInterface $protocol): void { foreach (self::PROTOCOLS as $protocolVersion => $obj) { if (is_a($protocol, $obj)) { - $this->protocols[$protocolVersion] = $obj; - break; + $this->protocols[$protocolVersion] = $protocol; + return; } } throw new InvalidServiceDefinitionException(