Skip to content

Commit 774bc9a

Browse files
Added support for bolt 5.3. Fixed bug with version 5.2. Minor changes. (#123)
1 parent 049a49d commit 774bc9a

21 files changed

+250
-94
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.1', '5.2', '5.3', '5.4', '5.5']
16+
neo4j-version: ['5.4', '5.6', '5.8', '5.12']
1717
php-version: ['8.0', '8.1', '8.2']
1818

1919
services:

README.md

Lines changed: 2 additions & 2 deletions
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 **Neo4j <= 5.7** with **Bolt <= 5.2**.
19+
We are trying to keep up and this library supports **Bolt <= 5.3**.
2020

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

@@ -33,7 +33,7 @@ Not all new features are implement backwards and this readme is updated to lates
3333
- [sockets](https://www.php.net/manual/en/book.sockets.php) (optional) - Required when you use Socket connection class
3434
- [openssl](https://www.php.net/manual/en/book.openssl.php) (optional) - Required when you use StreamSocket connection
3535
class with enabled SSL
36-
- [phpunit](https://phpunit.de/) >= 9 (development)
36+
- [phpunit](https://phpunit.de/) (development)
3737

3838
## Installation
3939

src/protocol/V5_3.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace Bolt\protocol;
4+
5+
/**
6+
* Class Protocol version 5.3
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_3 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+
}

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};
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};
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
17+
public function reset(): V1|V2|V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
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};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
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
17+
public function begin(array $extra = []): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
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};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
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
17+
public function commit(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
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};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
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
17+
public function rollback(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
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};
5+
use Bolt\protocol\{ServerState, Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
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
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
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};
5+
use Bolt\protocol\{ServerState, Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
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
18+
public function discard(array $extra = []): V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3
1919
{
2020
$this->serverState->is(ServerState::READY, ServerState::TX_READY, ServerState::STREAMING, ServerState::TX_STREAMING);
2121

src/protocol/v4/PullMessage.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};
5+
use Bolt\protocol\{ServerState, Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3};
66
use Bolt\error\BoltException;
77

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

0 commit comments

Comments
 (0)