Skip to content

Commit 8a564ee

Browse files
committed
Restore getServerVersion() method to ConnectionInterface and BoltConnection for better developer experience
1 parent 8168247 commit 8a564ee

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Bolt/BoltConnection.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ public function getServerAgent(): string
101101
return $this->config->getServerAgent();
102102
}
103103

104+
/**
105+
* @psalm-mutation-free
106+
*/
107+
public function getServerVersion(): string
108+
{
109+
return explode('/', $this->getServerAgent())[1] ?? '';
110+
}
111+
104112
/**
105113
* @psalm-mutation-free
106114
*/

src/Contracts/ConnectionInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ public function getServerAgent(): string;
5151
*/
5252
public function getServerAddress(): UriInterface;
5353

54+
/**
55+
* Returns the version of the neo4j server.
56+
*
57+
* @psalm-mutation-free
58+
*/
59+
public function getServerVersion(): string;
60+
5461
/**
5562
* Returns the assumed server state.
5663
*/

0 commit comments

Comments
 (0)