Skip to content

Commit 9ea1b55

Browse files
v54 (#125)
* Added support for 5.4. Missing tests because Neo4j 5.13 not available yet. * Uncommented new version for compatibility * Added new message
1 parent 774bc9a commit 9ea1b55

File tree

15 files changed

+123
-20
lines changed

15 files changed

+123
-20
lines changed

.github/workflows/db.50.2204.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
neo4j-version: ['5.4', '5.6', '5.8', '5.12']
16+
neo4j-version: ['5.4', '5.6', '5.8', '5.12', '5.13']
1717
php-version: ['8.0', '8.1', '8.2']
1818

1919
services:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ all available versions and keep up with protocol messages architecture and speci
1616

1717
## Version support
1818

19-
We are trying to keep up and this library supports **Bolt <= 5.3**.
19+
We are trying to keep up and this library supports **Bolt <= 5.4**.
2020

2121
https://www.neo4j.com/docs/bolt/current/bolt-compatibility/
2222

@@ -121,6 +121,7 @@ foreach ($protocol->getResponses() as $response) {
121121
| commit | Commit transaction | |
122122
| rollback | Rollback transaction | |
123123
| reset | Send message to reset connection | |
124+
| telemetry | | int $api |
124125
| getVersion | Get used protocol version | |
125126
| getResponse | Get waiting response from server | |
126127
| getResponses | Get waiting responses from server | |

src/protocol/Response.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Response
2525
public const MESSAGE_ACK_FAILURE = 'ACK_FAILURE';
2626
public const MESSAGE_LOGON = 'LOGON';
2727
public const MESSAGE_LOGOFF = 'LOGOFF';
28+
public const MESSAGE_TELEMETRY = 'TELEMETRY';
2829

2930
public const SIGNATURE_SUCCESS = 0x70; //112
3031
public const SIGNATURE_FAILURE = 0x7F; //127

src/protocol/V5_4.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace Bolt\protocol;
4+
5+
/**
6+
* Class Protocol version 5.4
7+
*
8+
* @author Michal Stefanak
9+
* @link https://github.com/neo4j-php/Bolt
10+
* @see https://www.neo4j.com/docs/bolt/current/bolt/message/
11+
* @package Bolt\protocol
12+
*/
13+
class V5_4 extends AProtocol
14+
{
15+
use \Bolt\protocol\v5\AvailableStructures;
16+
17+
use \Bolt\protocol\v1\ResetMessage;
18+
19+
use \Bolt\protocol\v3\RunMessage;
20+
use \Bolt\protocol\v3\BeginMessage;
21+
use \Bolt\protocol\v3\CommitMessage;
22+
use \Bolt\protocol\v3\RollbackMessage;
23+
use \Bolt\protocol\v3\GoodbyeMessage;
24+
25+
use \Bolt\protocol\v4\PullMessage;
26+
use \Bolt\protocol\v4\DiscardMessage;
27+
28+
use \Bolt\protocol\v4_4\RouteMessage;
29+
30+
use \Bolt\protocol\v5_1\LogonMessage;
31+
use \Bolt\protocol\v5_1\LogoffMessage;
32+
33+
use \Bolt\protocol\v5_3\HelloMessage;
34+
35+
use \Bolt\protocol\v5_4\TelemetryMessage;
36+
}

src/protocol/v1/ResetMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bolt\protocol\v1;
44

5-
use Bolt\protocol\{ServerState, Response, V1, V2, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
5+
use Bolt\protocol\{ServerState, Response, V1, V2, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4};
66
use Bolt\error\BoltException;
77

88
trait ResetMessage
@@ -14,7 +14,7 @@ trait ResetMessage
1414
* @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-reset
1515
* @throws BoltException
1616
*/
17-
public function reset(): V1|V2|V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
17+
public function reset(): V1|V2|V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4
1818
{
1919
$this->write($this->packer->pack(0x0F));
2020
$this->pipelinedMessages[] = __FUNCTION__;

src/protocol/v3/BeginMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bolt\protocol\v3;
44

5-
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4};
66
use Bolt\error\BoltException;
77

88
trait BeginMessage
@@ -14,7 +14,7 @@ trait BeginMessage
1414
* @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-begin
1515
* @throws BoltException
1616
*/
17-
public function begin(array $extra = []): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
17+
public function begin(array $extra = []): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4
1818
{
1919
$this->serverState->is(ServerState::READY);
2020
$this->write($this->packer->pack(0x11, (object)$extra));

src/protocol/v3/CommitMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bolt\protocol\v3;
44

5-
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4};
66
use Bolt\error\BoltException;
77

88
trait CommitMessage
@@ -14,7 +14,7 @@ trait CommitMessage
1414
* @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-commit
1515
* @throws BoltException
1616
*/
17-
public function commit(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
17+
public function commit(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4
1818
{
1919
$this->serverState->is(ServerState::TX_READY, ServerState::TX_STREAMING);
2020
$this->write($this->packer->pack(0x12));

src/protocol/v3/RollbackMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bolt\protocol\v3;
44

5-
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4};
66
use Bolt\error\BoltException;
77

88
trait RollbackMessage
@@ -14,7 +14,7 @@ trait RollbackMessage
1414
* @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-rollback
1515
* @throws BoltException
1616
*/
17-
public function rollback(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
17+
public function rollback(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4
1818
{
1919
$this->serverState->is(ServerState::TX_READY, ServerState::TX_STREAMING);
2020
$this->write($this->packer->pack(0x13));

src/protocol/v3/RunMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bolt\protocol\v3;
44

5-
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4};
66
use Bolt\error\BoltException;
77

88
trait RunMessage
@@ -14,7 +14,7 @@ trait RunMessage
1414
* @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-run
1515
* @throws BoltException
1616
*/
17-
public function run(string $query, array $parameters = [], array $extra = []): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
17+
public function run(string $query, array $parameters = [], array $extra = []): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4
1818
{
1919
$this->serverState->is(ServerState::READY, ServerState::TX_READY, ServerState::STREAMING, ServerState::TX_STREAMING);
2020

src/protocol/v4/DiscardMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bolt\protocol\v4;
44

5-
use Bolt\protocol\{ServerState, Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
5+
use Bolt\protocol\{ServerState, Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4};
66
use Bolt\error\BoltException;
77

88
trait DiscardMessage
@@ -15,7 +15,7 @@ trait DiscardMessage
1515
* @param array $extra [n::Integer, qid::Integer]
1616
* @throws BoltException
1717
*/
18-
public function discard(array $extra = []): V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
18+
public function discard(array $extra = []): V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4
1919
{
2020
$this->serverState->is(ServerState::READY, ServerState::TX_READY, ServerState::STREAMING, ServerState::TX_STREAMING);
2121

0 commit comments

Comments
 (0)