File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 15
15
16
16
use Bolt \Bolt ;
17
17
use Bolt \connection \IConnection ;
18
- use Bolt \error \ConnectException ;
19
18
use Bolt \protocol \V4_4 ;
20
19
use Bolt \protocol \V5 ;
21
20
use Bolt \protocol \V5_1 ;
@@ -33,18 +32,11 @@ class ProtocolFactory
33
32
public function createProtocol (IConnection $ connection , AuthenticateInterface $ auth , string $ userAgent ): array
34
33
{
35
34
$ bolt = new Bolt ($ connection );
36
- $ bolt ->setProtocolVersions (5.4 , 5.3 , 5 , 4.4 );
37
-
38
- try {
39
- $ protocol = $ bolt ->build ();
40
- } catch (ConnectException $ e ) {
41
- // Assume incorrect protocol version
42
- $ bolt ->setProtocolVersions (5.2 , 5.1 );
43
- $ protocol = $ bolt ->build ();
44
- }
35
+ $ bolt ->setProtocolVersions ('5.4.4 ' , 4.4 );
36
+ $ protocol = $ bolt ->build ();
45
37
46
38
if (!($ protocol instanceof V4_4 || $ protocol instanceof V5 || $ protocol instanceof V5_1 || $ protocol instanceof V5_2 || $ protocol instanceof V5_3 || $ protocol instanceof V5_4 )) {
47
- throw new RuntimeException ('Client only supports bolt version 4.4 and ^5.0 ' );
39
+ throw new RuntimeException ('Client only supports bolt version 4.4 to 5.4 ' );
48
40
}
49
41
50
42
$ response = $ auth ->authenticateBolt ($ protocol , $ userAgent );
You can’t perform that action at this time.
0 commit comments