From 39e04777e8715d9fb90b6d4c2a560b71f61660a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0tefa=C5=88=C3=A1k?= Date: Wed, 5 Mar 2025 09:53:20 +0100 Subject: [PATCH 1/2] Update ProtocolFactory.php --- src/Bolt/ProtocolFactory.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Bolt/ProtocolFactory.php b/src/Bolt/ProtocolFactory.php index 4f9294ba..a892a866 100644 --- a/src/Bolt/ProtocolFactory.php +++ b/src/Bolt/ProtocolFactory.php @@ -33,18 +33,11 @@ class ProtocolFactory public function createProtocol(IConnection $connection, AuthenticateInterface $auth, string $userAgent): array { $bolt = new Bolt($connection); - $bolt->setProtocolVersions(5.4, 5.3, 5, 4.4); - - try { - $protocol = $bolt->build(); - } catch (ConnectException $e) { - // Assume incorrect protocol version - $bolt->setProtocolVersions(5.2, 5.1); - $protocol = $bolt->build(); - } + $bolt->setProtocolVersions('5.4.4', 4.4); + $protocol = $bolt->build(); if (!($protocol instanceof V4_4 || $protocol instanceof V5 || $protocol instanceof V5_1 || $protocol instanceof V5_2 || $protocol instanceof V5_3 || $protocol instanceof V5_4)) { - throw new RuntimeException('Client only supports bolt version 4.4 and ^5.0'); + throw new RuntimeException('Client only supports bolt version 4.4 to 5.4'); } $response = $auth->authenticateBolt($protocol, $userAgent); From e2c39aa87132097001526c661cdc34fb40029f46 Mon Sep 17 00:00:00 2001 From: Ghlen Nagels Date: Sun, 9 Mar 2025 17:03:49 +0530 Subject: [PATCH 2/2] fix cs --- src/Bolt/ProtocolFactory.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bolt/ProtocolFactory.php b/src/Bolt/ProtocolFactory.php index a892a866..a316174b 100644 --- a/src/Bolt/ProtocolFactory.php +++ b/src/Bolt/ProtocolFactory.php @@ -15,7 +15,6 @@ use Bolt\Bolt; use Bolt\connection\IConnection; -use Bolt\error\ConnectException; use Bolt\protocol\V4_4; use Bolt\protocol\V5; use Bolt\protocol\V5_1;