File tree Expand file tree Collapse file tree 7 files changed +73
-7
lines changed Expand file tree Collapse file tree 7 files changed +73
-7
lines changed Original file line number Diff line number Diff line change 26
26
*/
27
27
final class Driver implements DriverInterface
28
28
{
29
- /** @var DriverInterface DriverInterface <SummarizedResult<CypherMap>> */
29
+ /** @var DriverInterface<SummarizedResult<CypherMap>> */
30
30
private DriverInterface $ driver ;
31
31
32
32
/**
Original file line number Diff line number Diff line change 13
13
14
14
namespace Laudis \Neo4j \Databags ;
15
15
16
+ use Laudis \Neo4j \Types \AbstractCypherObject ;
17
+
16
18
/**
17
19
* Stores relevant information of a database.
18
20
*
19
21
* @psalm-immutable
20
22
*/
21
- final class DatabaseInfo
23
+ final class DatabaseInfo extends AbstractCypherObject
22
24
{
23
25
private string $ name ;
24
26
@@ -34,4 +36,9 @@ public function getName(): string
34
36
{
35
37
return $ this ->name ;
36
38
}
39
+
40
+ public function toArray (): array
41
+ {
42
+ return ['name ' => $ this ->name ];
43
+ }
37
44
}
Original file line number Diff line number Diff line change 13
13
14
14
namespace Laudis \Neo4j \Databags ;
15
15
16
+ use Laudis \Neo4j \Types \AbstractCypherObject ;
16
17
use Laudis \Neo4j \Types \CypherList ;
17
18
use Laudis \Neo4j \Types \CypherMap ;
18
19
23
24
*
24
25
* @psalm-immutable
25
26
*/
26
- final class Plan
27
+ final class Plan extends AbstractCypherObject
27
28
{
28
29
/** @var CypherMap<mixed> */
29
30
private CypherMap $ arguments ;
@@ -87,4 +88,14 @@ public function getOperator(): string
87
88
{
88
89
return $ this ->operator ;
89
90
}
91
+
92
+ public function toArray (): array
93
+ {
94
+ return [
95
+ 'arguments ' => $ this ->arguments ,
96
+ 'list ' => $ this ->list ,
97
+ 'identifiers ' => $ this ->identifiers ,
98
+ 'operator ' => $ this ->operator ,
99
+ ];
100
+ }
90
101
}
Original file line number Diff line number Diff line change 13
13
14
14
namespace Laudis \Neo4j \Databags ;
15
15
16
+ use Laudis \Neo4j \Types \AbstractCypherObject ;
16
17
use Laudis \Neo4j \Types \CypherList ;
17
18
18
19
/**
22
23
*
23
24
* @psalm-immutable
24
25
*/
25
- final class ProfiledPlan
26
+ final class ProfiledPlan extends AbstractCypherObject
26
27
{
27
28
/** @var CypherList<ProfiledPlan> */
28
29
private CypherList $ children ;
@@ -120,4 +121,18 @@ public function getTime(): int
120
121
{
121
122
return $ this ->time ;
122
123
}
124
+
125
+ public function toArray (): array
126
+ {
127
+ return [
128
+ 'children ' => $ this ->children ,
129
+ 'dbHits ' => $ this ->dbHits ,
130
+ 'hasPageCacheStats ' => $ this ->hasPageCacheStats ,
131
+ 'pageCacheHitRatio ' => $ this ->pageCacheHitRatio ,
132
+ 'pageCacheHits ' => $ this ->pageCacheHits ,
133
+ 'pageCacheMisses ' => $ this ->pageCacheMisses ,
134
+ 'records ' => $ this ->records ,
135
+ 'time ' => $ this ->time ,
136
+ ];
137
+ }
123
138
}
Original file line number Diff line number Diff line change 14
14
namespace Laudis \Neo4j \Databags ;
15
15
16
16
use Laudis \Neo4j \Enum \QueryTypeEnum ;
17
+ use Laudis \Neo4j \Types \AbstractCypherObject ;
17
18
use Laudis \Neo4j \Types \CypherList ;
18
19
19
20
/**
28
29
*
29
30
* @psalm-immutable
30
31
*/
31
- final class ResultSummary
32
+ final class ResultSummary extends AbstractCypherObject
32
33
{
33
34
private SummaryCounters $ counters ;
34
35
private DatabaseInfo $ databaseInfo ;
@@ -150,4 +151,20 @@ public function getServerInfo(): ServerInfo
150
151
{
151
152
return $ this ->serverInfo ;
152
153
}
154
+
155
+ public function toArray (): array
156
+ {
157
+ return [
158
+ 'counters ' => $ this ->counters ,
159
+ 'databaseInfo ' => $ this ->databaseInfo ,
160
+ 'notifications ' => $ this ->notifications ,
161
+ 'plan ' => $ this ->plan ,
162
+ 'profiledPlan ' => $ this ->profiledPlan ,
163
+ 'statement ' => $ this ->statement ,
164
+ 'queryType ' => $ this ->queryType ,
165
+ 'resultAvailableAfter ' => $ this ->resultAvailableAfter ,
166
+ 'resultConsumedAfter ' => $ this ->resultConsumedAfter ,
167
+ 'serverInfo ' => $ this ->serverInfo ,
168
+ ];
169
+ }
153
170
}
Original file line number Diff line number Diff line change 14
14
namespace Laudis \Neo4j \Databags ;
15
15
16
16
use Laudis \Neo4j \Enum \ConnectionProtocol ;
17
+ use Laudis \Neo4j \Types \AbstractCypherObject ;
17
18
use Psr \Http \Message \UriInterface ;
18
19
19
20
/**
20
21
* Provides some basic information of the server where the result is obtained from.
21
22
*
22
23
* @psalm-immutable
23
24
*/
24
- final class ServerInfo
25
+ final class ServerInfo extends AbstractCypherObject
25
26
{
26
27
private UriInterface $ address ;
27
28
private ConnectionProtocol $ protocol ;
@@ -57,4 +58,13 @@ public function getAgent(): string
57
58
{
58
59
return $ this ->agent ;
59
60
}
61
+
62
+ public function toArray (): array
63
+ {
64
+ return [
65
+ 'address ' => $ this ->address ,
66
+ 'protocol ' => $ this ->protocol ,
67
+ 'agent ' => $ this ->agent ,
68
+ ];
69
+ }
60
70
}
Original file line number Diff line number Diff line change 14
14
namespace Laudis \Neo4j \Enum ;
15
15
16
16
use Bolt \Bolt ;
17
+ use JsonSerializable ;
17
18
use Laudis \TypedEnum \TypedEnum ;
18
19
19
20
/**
32
33
*
33
34
* @psalm-suppress MutableDependency
34
35
*/
35
- final class ConnectionProtocol extends TypedEnum
36
+ final class ConnectionProtocol extends TypedEnum implements JsonSerializable
36
37
{
37
38
private const BOLT_V3 = 'bolt-v3 ' ;
38
39
private const BOLT_V40 = 'bolt-v40 ' ;
@@ -88,4 +89,9 @@ public function compare(ConnectionProtocol $protocol): int
88
89
89
90
return $ x - $ y ;
90
91
}
92
+
93
+ public function jsonSerialize (): string
94
+ {
95
+ return $ this ->getValue ();
96
+ }
91
97
}
You can’t perform that action at this time.
0 commit comments