Skip to content

Commit 26f7af1

Browse files
moved structures to protocol. added new protocol version structures. moved Bytes as data type into PackStream.
1 parent 2b02292 commit 26f7af1

29 files changed

+454
-102
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

3-
namespace Bolt\structures;
3+
namespace Bolt\PackStream;
44

55
use ArrayAccess, Countable;
66

77
/**
8-
* Class ByteArray
8+
* Class Bytes
99
*
1010
* @author Michal Stefanak
1111
* @link https://github.com/neo4j-php/Bolt
1212
* @link https://www.neo4j.com/docs/bolt/current/packstream/#data-type-bytes
13-
* @package Bolt\structures
13+
* @package Bolt\PackStream
1414
*/
1515
class Bytes implements ArrayAccess, Countable
1616
{

src/PackStream/v1/Packer.php

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

33
namespace Bolt\PackStream\v1;
44

5-
use Bolt\PackStream\IPacker;
65
use Bolt\error\PackException;
7-
use Bolt\PackStream\{IPackListGenerator, IPackDictionaryGenerator};
8-
use Bolt\structures\{
9-
IStructure,
10-
Date,
11-
Time,
12-
LocalTime,
13-
DateTime,
14-
DateTimeZoneId,
15-
LocalDateTime,
16-
Duration,
17-
Point2D,
18-
Point3D,
19-
Bytes
20-
};
6+
use Bolt\PackStream\{Bytes, IPackDictionaryGenerator, IPackListGenerator, IPacker};
7+
use Bolt\protocol\IStructure;
218

229
/**
2310
* Class Packer of PackStream version 1

src/PackStream/v1/Unpacker.php

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,9 @@
22

33
namespace Bolt\PackStream\v1;
44

5-
use Bolt\structures\{
6-
IStructure,
7-
Node,
8-
Relationship,
9-
UnboundRelationship,
10-
Path,
11-
Date,
12-
Time,
13-
LocalTime,
14-
DateTime,
15-
DateTimeZoneId,
16-
LocalDateTime,
17-
Duration,
18-
Point2D,
19-
Point3D,
20-
Bytes
21-
};
22-
use Bolt\PackStream\IUnpacker;
235
use Bolt\error\UnpackException;
6+
use Bolt\PackStream\Bytes;
7+
use Bolt\PackStream\IUnpacker;
248

259
/**
2610
* Class Unpacker of PackStream version 1
@@ -135,7 +119,7 @@ private function u()
135119

136120
/**
137121
* @param int $marker
138-
* @return array|IStructure|null
122+
* @return array|\Bolt\protocol\IStructure|null
139123
* @throws UnpackException
140124
*/
141125
private function unpackStruct(int $marker)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Bolt\structures;
3+
namespace Bolt\protocol;
44

55
/**
66
* interface IStructure
77
*
88
* @author Michal Stefanak
99
* @link https://github.com/neo4j-php/Bolt
10-
* @package Bolt\structures
10+
* @package Bolt\protocol
1111
*/
1212
interface IStructure
1313
{

src/protocol/V5.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Bolt\protocol;
4+
5+
/**
6+
* Class Protocol version 5
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 extends AProtocol
14+
{
15+
use \Bolt\protocol\v5\SetAvailableStructures;
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_1\HelloMessage;
29+
30+
use \Bolt\protocol\v4_4\RouteMessage;
31+
}

src/protocol/V5_1.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Bolt\protocol;
4+
5+
/**
6+
* Class Protocol version 5.1
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_1 extends AProtocol
14+
{
15+
use \Bolt\protocol\v5\SetAvailableStructures;
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_1\HelloMessage;
29+
30+
use \Bolt\protocol\v4_4\RouteMessage;
31+
}

src/protocol/v1/SetAvailableStructures.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bolt\protocol\v1;
44

5-
use Bolt\structures\{
5+
use Bolt\protocol\v1\structures\{
66
Date,
77
DateTime,
88
DateTimeZoneId,
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Bolt\structures;
3+
namespace Bolt\protocol\v1\structures;
4+
5+
use Bolt\protocol\IStructure;
46

57
/**
68
* Class Date
@@ -10,8 +12,8 @@
1012
*
1113
* @author Michal Stefanak
1214
* @link https://github.com/neo4j-php/Bolt
13-
* @link https://www.neo4j.com/docs/bolt/current/packstream/#structure-date
14-
* @package Bolt\structures
15+
* @link https://www.neo4j.com/docs/bolt/current/bolt/structure-semantics/#structure-date
16+
* @package Bolt\protocol\v1\structures
1517
*/
1618
class Date implements IStructure
1719
{
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Bolt\structures;
3+
namespace Bolt\protocol\v1\structures;
4+
5+
use Bolt\protocol\IStructure;
46

57
/**
68
* Class DateTime
@@ -14,8 +16,8 @@
1416
*
1517
* @author Michal Stefanak
1618
* @link https://github.com/neo4j-php/Bolt
17-
* @link https://www.neo4j.com/docs/bolt/current/packstream/#structure-datetime
18-
* @package Bolt\structures
19+
* @link https://www.neo4j.com/docs/bolt/current/bolt/structure-semantics/#structure-legacy-datetime
20+
* @package Bolt\protocol\v1\structures
1921
*/
2022
class DateTime implements IStructure
2123
{

src/structures/DateTimeZoneId.php renamed to src/protocol/v1/structures/DateTimeZoneId.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Bolt\structures;
3+
namespace Bolt\protocol\v1\structures;
4+
5+
use Bolt\protocol\IStructure;
46

57
/**
68
* Class DateTimeZoneId
@@ -14,8 +16,8 @@
1416
*
1517
* @author Michal Stefanak
1618
* @link https://github.com/neo4j-php/Bolt
17-
* @link https://www.neo4j.com/docs/bolt/current/packstream/#structure-datetimezoneid
18-
* @package Bolt\structures
19+
* @link https://www.neo4j.com/docs/bolt/current/bolt/structure-semantics/#structure-legacy-datetimezoneid
20+
* @package Bolt\protocol\v1\structures
1921
*/
2022
class DateTimeZoneId implements IStructure
2123
{

0 commit comments

Comments
 (0)