diff --git a/.github/workflows/db.50.2204.yml b/.github/workflows/db.50.2204.yml index 226e1a4..27fd7d7 100644 --- a/.github/workflows/db.50.2204.yml +++ b/.github/workflows/db.50.2204.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - neo4j-version: ['5.4', '5.6', '5.8', '5.12', '5.13'] + neo4j-version: ['5.4', '5.6', '5.8', '5.12', '5.13', '5.23'] php-version: ['8.1', '8.2', '8.3'] services: diff --git a/src/protocol/V5_6.php b/src/protocol/V5_6.php new file mode 100644 index 0000000..399a48c --- /dev/null +++ b/src/protocol/V5_6.php @@ -0,0 +1,37 @@ +write($this->packer->pack(0x0F)); $this->pipelinedMessages[] = Message::RESET; diff --git a/src/protocol/v3/BeginMessage.php b/src/protocol/v3/BeginMessage.php index 487f6d3..4aad596 100644 --- a/src/protocol/v3/BeginMessage.php +++ b/src/protocol/v3/BeginMessage.php @@ -3,7 +3,7 @@ namespace Bolt\protocol\v3; use Bolt\enum\Message; -use Bolt\protocol\{V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait BeginMessage @@ -15,7 +15,7 @@ trait BeginMessage * @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-begin * @throws BoltException */ - public function begin(array $extra = []): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4 + public function begin(array $extra = []): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4|V5_6 { $this->write($this->packer->pack(0x11, (object)$extra)); $this->pipelinedMessages[] = Message::BEGIN; diff --git a/src/protocol/v3/CommitMessage.php b/src/protocol/v3/CommitMessage.php index cece762..b024269 100644 --- a/src/protocol/v3/CommitMessage.php +++ b/src/protocol/v3/CommitMessage.php @@ -3,7 +3,7 @@ namespace Bolt\protocol\v3; use Bolt\enum\Message; -use Bolt\protocol\{Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait CommitMessage @@ -15,7 +15,7 @@ trait CommitMessage * @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-commit * @throws BoltException */ - public function commit(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4 + public function commit(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4|V5_6 { $this->write($this->packer->pack(0x12)); $this->pipelinedMessages[] = Message::COMMIT; diff --git a/src/protocol/v3/RollbackMessage.php b/src/protocol/v3/RollbackMessage.php index fa67d54..b8da7dd 100644 --- a/src/protocol/v3/RollbackMessage.php +++ b/src/protocol/v3/RollbackMessage.php @@ -3,7 +3,7 @@ namespace Bolt\protocol\v3; use Bolt\enum\Message; -use Bolt\protocol\{Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait RollbackMessage @@ -15,7 +15,7 @@ trait RollbackMessage * @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-rollback * @throws BoltException */ - public function rollback(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4 + public function rollback(): V3|V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4|V5_6 { $this->write($this->packer->pack(0x13)); $this->pipelinedMessages[] = Message::ROLLBACK; diff --git a/src/protocol/v3/RunMessage.php b/src/protocol/v3/RunMessage.php index 52b73d8..6e03ab2 100644 --- a/src/protocol/v3/RunMessage.php +++ b/src/protocol/v3/RunMessage.php @@ -3,7 +3,7 @@ namespace Bolt\protocol\v3; use Bolt\enum\Message; -use Bolt\protocol\{Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{Response, V3, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait RunMessage @@ -15,7 +15,7 @@ trait RunMessage * @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-run * @throws BoltException */ - 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 + 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|V5_6 { $this->write($this->packer->pack( 0x10, diff --git a/src/protocol/v4/DiscardMessage.php b/src/protocol/v4/DiscardMessage.php index fdce66c..9102fdb 100644 --- a/src/protocol/v4/DiscardMessage.php +++ b/src/protocol/v4/DiscardMessage.php @@ -4,7 +4,7 @@ use Bolt\enum\Message; use Bolt\enum\Signature; -use Bolt\protocol\{Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait DiscardMessage @@ -17,7 +17,7 @@ trait DiscardMessage * @param array $extra [n::Integer, qid::Integer] * @throws BoltException */ - public function discard(array $extra = []): V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4 + public function discard(array $extra = []): V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4|V5_6 { if (!array_key_exists('n', $extra)) $extra['n'] = -1; diff --git a/src/protocol/v4/PullMessage.php b/src/protocol/v4/PullMessage.php index 39aa70d..4559d94 100644 --- a/src/protocol/v4/PullMessage.php +++ b/src/protocol/v4/PullMessage.php @@ -3,7 +3,7 @@ namespace Bolt\protocol\v4; use Bolt\enum\{Message, Signature}; -use Bolt\protocol\{Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{Response, V4, V4_1, V4_2, V4_3, V4_4, V5, V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait PullMessage @@ -16,7 +16,7 @@ trait PullMessage * @param array $extra [n::Integer, qid::Integer] * @throws BoltException */ - public function pull(array $extra = []): V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4 + public function pull(array $extra = []): V4|V4_1|V4_2|V4_3|V4_4|V5|V5_1|V5_2|V5_3|V5_4|V5_6 { if (!array_key_exists('n', $extra)) $extra['n'] = -1; diff --git a/src/protocol/v4_4/RouteMessage.php b/src/protocol/v4_4/RouteMessage.php index 3078232..43f7901 100644 --- a/src/protocol/v4_4/RouteMessage.php +++ b/src/protocol/v4_4/RouteMessage.php @@ -3,7 +3,7 @@ namespace Bolt\protocol\v4_4; use Bolt\enum\Message; -use Bolt\protocol\{V4_4, V5, V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{V4_4, V5, V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait RouteMessage @@ -16,7 +16,7 @@ trait RouteMessage * @param array $extra [db::String, imp_user::String] * @throws BoltException */ - public function route(array $routing, array $bookmarks = [], array $extra = []): V4_4|V5|V5_1|V5_2|V5_3|V5_4 + public function route(array $routing, array $bookmarks = [], array $extra = []): V4_4|V5|V5_1|V5_2|V5_3|V5_4|V5_6 { $this->write($this->packer->pack(0x66, (object)$routing, $bookmarks, (object)$extra)); $this->pipelinedMessages[] = Message::ROUTE; diff --git a/src/protocol/v5_1/HelloMessage.php b/src/protocol/v5_1/HelloMessage.php index 06a2649..231ab35 100644 --- a/src/protocol/v5_1/HelloMessage.php +++ b/src/protocol/v5_1/HelloMessage.php @@ -3,7 +3,7 @@ namespace Bolt\protocol\v5_1; use Bolt\enum\Message; -use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait HelloMessage @@ -15,7 +15,7 @@ trait HelloMessage * @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-hello * @throws BoltException */ - public function hello(array $extra = []): V5_1|V5_2|V5_3|V5_4 + public function hello(array $extra = []): V5_1|V5_2|V5_3|V5_4|V5_6 { if (empty($extra['user_agent'])) $extra['user_agent'] = 'bolt-php'; diff --git a/src/protocol/v5_1/LogoffMessage.php b/src/protocol/v5_1/LogoffMessage.php index 7c43ba8..f7869f9 100644 --- a/src/protocol/v5_1/LogoffMessage.php +++ b/src/protocol/v5_1/LogoffMessage.php @@ -4,7 +4,7 @@ use Bolt\enum\Message; use Bolt\error\BoltException; -use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4, V5_6}; trait LogoffMessage { @@ -15,7 +15,7 @@ trait LogoffMessage * @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-logoff * @throws BoltException */ - public function logoff(): V5_1|V5_2|V5_3|V5_4 + public function logoff(): V5_1|V5_2|V5_3|V5_4|V5_6 { $this->write($this->packer->pack(0x6B)); $this->pipelinedMessages[] = Message::LOGOFF; diff --git a/src/protocol/v5_1/LogonMessage.php b/src/protocol/v5_1/LogonMessage.php index 1b5d85a..a2fca5c 100644 --- a/src/protocol/v5_1/LogonMessage.php +++ b/src/protocol/v5_1/LogonMessage.php @@ -4,7 +4,7 @@ use Bolt\enum\Message; use Bolt\error\BoltException; -use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4, V5_6}; trait LogonMessage { @@ -15,7 +15,7 @@ trait LogonMessage * @link https://www.neo4j.com/docs/bolt/current/bolt/message/#messages-logon * @throws BoltException */ - public function logon(array $auth): V5_1|V5_2|V5_3|V5_4 + public function logon(array $auth): V5_1|V5_2|V5_3|V5_4|V5_6 { $this->write($this->packer->pack(0x6A, (object)$auth)); $this->pipelinedMessages[] = Message::LOGON; diff --git a/src/protocol/v5_3/HelloMessage.php b/src/protocol/v5_3/HelloMessage.php index fc9d26a..ce7444d 100644 --- a/src/protocol/v5_3/HelloMessage.php +++ b/src/protocol/v5_3/HelloMessage.php @@ -2,7 +2,7 @@ namespace Bolt\protocol\v5_3; -use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4}; +use Bolt\protocol\{V5_1, V5_2, V5_3, V5_4, V5_6}; use Bolt\error\BoltException; trait HelloMessage @@ -19,7 +19,7 @@ trait HelloMessage * @param array $extra Use \Bolt\helpers\Auth to generate appropiate array * @throws BoltException */ - public function hello(array $extra = []): V5_1|V5_2|V5_3|V5_4 + public function hello(array $extra = []): V5_1|V5_2|V5_3|V5_4|V5_6 { $extra['bolt_agent'] = [ 'product' => 'php-bolt/' . \Composer\InstalledVersions::getPrettyVersion('stefanak-michal/bolt'), diff --git a/src/protocol/v5_4/TelemetryMessage.php b/src/protocol/v5_4/TelemetryMessage.php index ace38cc..563b416 100644 --- a/src/protocol/v5_4/TelemetryMessage.php +++ b/src/protocol/v5_4/TelemetryMessage.php @@ -2,7 +2,7 @@ namespace Bolt\protocol\v5_4; -use Bolt\protocol\V5_4; +use Bolt\protocol\{V5_4, V5_6}; use Bolt\enum\Message; use Bolt\error\BoltException; @@ -15,7 +15,7 @@ trait TelemetryMessage * @link https://neo4j.com/docs/bolt/current/bolt/message/#messages-telemetry * @throws BoltException */ - public function telemetry(int $api): V5_4 + public function telemetry(int $api): V5_4|V5_6 { $this->write($this->packer->pack(0x54, $api)); $this->pipelinedMessages[] = Message::TELEMETRY; diff --git a/tests/TestLayer.php b/tests/TestLayer.php index 63e0bf2..76d1a65 100644 --- a/tests/TestLayer.php +++ b/tests/TestLayer.php @@ -75,6 +75,8 @@ protected function getCompatibleBoltVersion(string $url = null): float|int $neo4jVersion = $decoded['neo4j_version']; + if (version_compare($neo4jVersion, '5.23', '>=')) + return 5.6; if (version_compare($neo4jVersion, '5.13', '>=')) return 5.4; if (version_compare($neo4jVersion, '5.9', '>=')) diff --git a/tests/protocol/V5_6Test.php b/tests/protocol/V5_6Test.php new file mode 100644 index 0000000..6a891cc --- /dev/null +++ b/tests/protocol/V5_6Test.php @@ -0,0 +1,20 @@ +mockConnection()); + $this->assertInstanceOf(V5_6::class, $cls); + return $cls; + } +}