File tree Expand file tree Collapse file tree 11 files changed +77
-16
lines changed Expand file tree Collapse file tree 11 files changed +77
-16
lines changed Original file line number Diff line number Diff line change 11# Bolt
22Bolt protocol library over TCP socket. Bolt protocol is created and in use for communication with [ Neo4j] ( https://neo4j.com/ ) Graph database. The documentation is available at [ https://7687.org/ ] ( https://7687.org/ ) . This library is aimed to be low level and keep up with protocol messages architecture and specifications.
33
4- ![ ] ( https://img.shields.io/badge/phpunit-passed-success ) ![ ] ( https://img.shields.io/badge/coverage-87 %25-green ) ![ ] ( https://img.shields.io/github/stars/stefanak-michal/Bolt ) ![ ] ( https://img.shields.io/packagist/dt/stefanak-michal/bolt ) ![ ] ( https://img.shields.io/github/v/release/stefanak-michal/bolt ) ![ ] ( https://img.shields.io/github/commits-since/stefanak-michal/bolt/latest )
4+ ![ ] ( https://img.shields.io/badge/phpunit-passed-success ) ![ ] ( https://img.shields.io/badge/coverage-86 %25-green ) ![ ] ( https://img.shields.io/github/stars/stefanak-michal/Bolt ) ![ ] ( https://img.shields.io/packagist/dt/stefanak-michal/bolt ) ![ ] ( https://img.shields.io/github/v/release/stefanak-michal/bolt ) ![ ] ( https://img.shields.io/github/commits-since/stefanak-michal/bolt/latest )
55
66## [ Version support] ( https://github.com/stefanak-michal/Bolt/wiki/Version-support )
77## [ Requirements] ( https://github.com/stefanak-michal/Bolt/wiki/Requirements )
Original file line number Diff line number Diff line change @@ -389,17 +389,17 @@ public function __destruct()
389389 }
390390
391391 /**
392- * fetch the current routing table, if the message specification allows it.
393- *
392+ * Fetch the current routing table, if the message specification allows it.
394393 * @param array|null $routing
395- *
396- * @return array{rt: array{servers: list<array{addresses: list<string>, role: 'WRITE'|'READ'|'ROUTE'}>, ttl: int}}|null
394+ * @return array|null
397395 */
398396 public function route (?array $ routing = null ): ?array
399397 {
400- if (!method_exists ($ this ->protocol , 'route ' )) {
398+ if (self ::$ debug )
399+ echo 'ROUTE ' ;
400+
401+ if (!method_exists ($ this ->protocol , 'route ' ))
401402 return null ;
402- }
403403
404404 $ routing = $ routing ?? ['address ' => $ this ->connection ->getIp () . ': ' . $ this ->connection ->getPort ()];
405405 return $ this ->protocol ->route ($ routing );
Original file line number Diff line number Diff line change 1111 *
1212 * @author Michal Stefanak
1313 * @link https://github.com/stefanak-michal/Bolt
14+ * @see https://7687.org/bolt/bolt-protocol-message-specification-1.html
1415 * @package Bolt\protocol
1516 */
1617class V1 extends AProtocol
@@ -48,7 +49,7 @@ public function init(...$args): array
4849 * @return array
4950 * @throws Exception
5051 */
51- public function run (...$ args )
52+ public function run (...$ args ): array
5253 {
5354 if (empty ($ args )) {
5455 throw new PackException ('Wrong arguments count ' );
@@ -70,7 +71,7 @@ public function run(...$args)
7071 * @return array
7172 * @throws Exception
7273 */
73- public function pullAll (...$ args )
74+ public function pullAll (...$ args ): array
7475 {
7576 $ this ->write ($ this ->packer ->pack (0x3F ));
7677
Original file line number Diff line number Diff line change 77 *
88 * @author Michal Stefanak
99 * @link https://github.com/stefanak-michal/Bolt
10+ * @see https://7687.org/bolt/bolt-protocol-message-specification-2.html
1011 * @package Bolt\protocol
1112 */
1213class V2 extends V1
Original file line number Diff line number Diff line change 1111 *
1212 * @author Michal Stefanak
1313 * @link https://github.com/stefanak-michal/Bolt
14+ * @see https://7687.org/bolt/bolt-protocol-message-specification-3.html
1415 * @package Bolt\protocol
1516 */
1617class V3 extends V2
@@ -53,11 +54,11 @@ public function hello(...$args): array
5354 }
5455
5556 /**
56- * @param mixed ...$args
57+ * @param string|array ...$args query, parameters, extra
5758 * @return array
5859 * @throws Exception
5960 */
60- public function run (...$ args )
61+ public function run (...$ args ): array
6162 {
6263 if (empty ($ args )) {
6364 throw new PackException ('Wrong arguments count ' );
Original file line number Diff line number Diff line change 1010 *
1111 * @author Michal Stefanak
1212 * @link https://github.com/stefanak-michal/Bolt
13+ * @see https://7687.org/bolt/bolt-protocol-message-specification-4.html
1314 * @package Bolt\protocol
1415 */
1516class V4 extends V3
1617{
1718
1819 /**
19- * @param mixed ...$args
20+ * @param array ...$args
2021 * @return array
2122 * @throws Exception
2223 */
23- public function pullAll (...$ args )
24+ public function pullAll (...$ args ): array
2425 {
2526 return $ this ->pull (...$ args );
2627 }
2728
2829 /**
29- * @param mixed ...$args
30+ * @param array ...$args
3031 * @return array
3132 * @throws Exception
3233 */
33- public function pull (...$ args )
34+ public function pull (...$ args ): array
3435 {
3536 $ this ->write ($ this ->packer ->pack (0x3F , $ args [0 ]));
3637
Original file line number Diff line number Diff line change 1111 *
1212 * @author Michal Stefanak
1313 * @link https://github.com/stefanak-michal/Bolt
14+ * @see https://7687.org/bolt/bolt-protocol-message-specification-4.html#version-41
1415 * @package Bolt\protocol
1516 */
1617class V4_1 extends V4
Original file line number Diff line number Diff line change 77 *
88 * @author Michal Stefanak
99 * @link https://github.com/stefanak-michal/Bolt
10+ * @see https://7687.org/bolt/bolt-protocol-message-specification-4.html#version-42
1011 * @package Bolt\protocol
1112 */
1213class V4_2 extends V4_1
Original file line number Diff line number Diff line change 1010 *
1111 * @author Michal Stefanak
1212 * @link https://github.com/neo4j-php/Bolt
13+ * @see https://7687.org/bolt/bolt-protocol-message-specification-4.html#version-43
1314 * @package Bolt\protocol
1415 */
15- class V4_3 extends V4_1
16+ class V4_3 extends V4_2
1617{
18+ /**
19+ * @param array|string|null ...$args
20+ * @return array
21+ * @throws MessageException
22+ * @throws PackException
23+ */
1724 public function route (...$ args ): array
1825 {
1926 if (count ($ args ) < 1 ) {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bolt \protocol ;
4+
5+ /**
6+ * Class Protocol version 4.4
7+ *
8+ * @author Michal Stefanak
9+ * @link https://github.com/neo4j-php/Bolt
10+ * @see https://7687.org/bolt/bolt-protocol-message-specification-4.html#version-44
11+ * @package Bolt\protocol
12+ */
13+ class V4_4 extends V4_3
14+ {
15+
16+ }
You can’t perform that action at this time.
0 commit comments