Skip to content

Commit 73a2eca

Browse files
PratikshaPratiksha
authored andcommitted
debug
1 parent 26373c2 commit 73a2eca

File tree

3 files changed

+88
-26
lines changed

3 files changed

+88
-26
lines changed

src/Neo4jQueryAPI.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public function __construct(ClientInterface $client, AuthenticateInterface $auth
3232
/**
3333
* @throws \Exception
3434
*/
35+
/**
36+
* @psalm-suppress PossiblyUnusedMethod
37+
*/
3538
public static function login(string $address, AuthenticateInterface $auth = null): self
3639
{
3740
$client = new Client([
@@ -163,9 +166,9 @@ private function handleException(RequestExceptionInterface $e): void
163166
/**
164167
* @psalm-suppress PossiblyUnusedMethod
165168
*/
166-
public function beginTransaction(string $database = 'neo4j'): Transaction
169+
public function beginTransaction(): Transaction
167170
{
168-
$request = new Request('POST', '/db/{$database}/query/v2/tx');
171+
$request = new Request('POST', '/db/neo4j/query/v2/tx');
169172
$request = $this->auth->authenticate($request);
170173
$request = $request->withHeader('Content-Type', 'application/json');
171174

src/Objects/ProfiledQueryPlanArguments.php

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,37 @@
55
class ProfiledQueryPlanArguments
66
{
77
public function __construct(
8-
private readonly ?int $globalMemory = null,
8+
private readonly ?int $globalMemory = null,
99
private readonly ?string $plannerImpl = null,
10-
private readonly ?int $memory = null,
10+
private readonly ?int $memory = null,
1111
private readonly ?string $stringRepresentation = null,
1212
private readonly ?string $runtime = null,
13-
private readonly ?int $time = null,
14-
private readonly ?int $pageCacheMisses = null,
15-
private readonly ?int $pageCacheHits = null,
13+
private readonly ?int $time = null,
14+
private readonly ?int $pageCacheMisses = null,
15+
// private readonly ?int $pageCacheHits = null,
1616
private readonly ?string $runtimeImpl = null,
17-
private readonly ?int $version = null,
18-
private readonly ?int $dbHits = null,
19-
private readonly ?int $batchSize = null,
17+
private readonly ?int $version = null,
18+
private readonly ?int $dbHits = null,
19+
private readonly ?int $batchSize = null,
2020
private readonly ?string $details = null,
2121
private readonly ?string $plannerVersion = null,
2222
private readonly ?string $pipelineInfo = null,
2323
private readonly ?string $runtimeVersion = null,
24-
private readonly ?int $id = null,
25-
private readonly ?float $estimatedRows = null,
24+
private readonly ?int $id = null,
25+
private readonly ?float $estimatedRows = null,
2626
private readonly ?string $planner = null,
27-
private readonly ?int $rows = null
27+
private readonly ?int $rows = null
2828
) {
2929
}
3030

31+
/**
32+
* @psalm-suppress PossiblyUnusedMethod
33+
*/
3134
public function getGlobalMemory(): ?int
3235
{
3336
return $this->globalMemory;
3437
}
38+
3539
/**
3640
* @psalm-suppress PossiblyUnusedMethod
3741
*/
@@ -47,13 +51,15 @@ public function getMemory(): ?int
4751
{
4852
return $this->memory;
4953
}
54+
5055
/**
5156
* @psalm-suppress PossiblyUnusedMethod
5257
*/
5358
public function getStringRepresentation(): ?string
5459
{
5560
return $this->stringRepresentation;
5661
}
62+
5763
/**
5864
* @psalm-suppress PossiblyUnusedMethod
5965
*/
@@ -62,76 +68,123 @@ public function getRuntime(): ?string
6268
return $this->runtime;
6369
}
6470

71+
/**
72+
* @psalm-suppress PossiblyUnusedMethod
73+
*/
6574
public function getTime(): ?int
6675
{
6776
return $this->time;
6877
}
6978

79+
/**
80+
* @psalm-suppress PossiblyUnusedMethod
81+
*/
82+
7083
public function getPageCacheMisses(): ?int
7184
{
7285
return $this->pageCacheMisses;
7386
}
7487

75-
private function getPageCacheHits(): ?int
88+
/**
89+
* @psalm-suppress PossiblyUnusedMethod
90+
*/
91+
/*private function getPageCacheHits(): ?int
7692
{
7793
return $this->pageCacheHits;
78-
}
94+
}*/
7995

96+
/**
97+
* @psalm-suppress PossiblyUnusedMethod
98+
*/
8099
public function getRuntimeImpl(): ?string
81100
{
82101
return $this->runtimeImpl;
83102
}
84103

104+
/**
105+
* @psalm-suppress PossiblyUnusedMethod
106+
*/
85107
public function getVersion(): ?int
86108
{
87109
return $this->version;
88110
}
89111

112+
/**
113+
* @psalm-suppress PossiblyUnusedMethod
114+
*/
115+
90116
public function getDbHits(): ?int
91117
{
92118
return $this->dbHits;
93119
}
94120

121+
/**
122+
* @psalm-suppress PossiblyUnusedMethod
123+
*/
95124
public function getBatchSize(): ?int
96125
{
97126
return $this->batchSize;
98127
}
99128

129+
/**
130+
* @psalm-suppress PossiblyUnusedMethod
131+
*/
100132
public function getDetails(): ?string
101133
{
102134
return $this->details;
103135
}
104136

137+
/**
138+
* @psalm-suppress PossiblyUnusedMethod
139+
*/
105140
public function getPlannerVersion(): ?string
106141
{
107142
return $this->plannerVersion;
108143
}
109144

145+
/**
146+
* @psalm-suppress PossiblyUnusedMethod
147+
*/
110148
public function getPipelineInfo(): ?string
111149
{
112150
return $this->pipelineInfo;
113151
}
114152

153+
/**
154+
* @psalm-suppress PossiblyUnusedMethod
155+
*/
115156
public function getRuntimeVersion(): ?string
116157
{
117158
return $this->runtimeVersion;
118159
}
119160

161+
/**
162+
* @psalm-suppress PossiblyUnusedMethod
163+
*/
120164
public function getId(): ?int
121165
{
122166
return $this->id;
123167
}
124168

169+
/**
170+
* @psalm-suppress PossiblyUnusedMethod
171+
*/
125172
public function getEstimatedRows(): ?float
126173
{
127174
return $this->estimatedRows;
128175
}
129176

177+
/**
178+
* @psalm-suppress PossiblyUnusedMethod
179+
*/
130180
public function getPlanner(): ?string
131181
{
132182
return $this->planner;
133183
}
134184

185+
/**
186+
* @psalm-suppress PossiblyUnusedMethod
187+
*/
135188
public function getRows(): ?int
136189
{
137190
return $this->rows;

src/Objects/ResultSet.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
use Countable;
77
use IteratorAggregate;
88
use Neo4j\QueryAPI\Results\ResultRow;
9+
use phpDocumentor\Reflection\DocBlock\Tags\Template;
910
use Traversable;
1011

11-
// Make sure to include the Bookmarks class
12-
12+
/**
13+
* @template-implements IteratorAggregate<int, ResultRow>
14+
*/
1315
class ResultSet implements IteratorAggregate, Countable
1416
{
1517
/**
@@ -20,34 +22,38 @@ public function __construct(
2022
private ResultCounters $counters,
2123
private Bookmarks $bookmarks,
2224
private ?ProfiledQueryPlan $profiledQueryPlan = null,
23-
private ?ProfiledQueryPlanArguments $profiledQueryPlanArguments = null
25+
// private ?ProfiledQueryPlanArguments $profiledQueryPlanArguments = null
2426
) {
2527
}
2628

2729
public function getIterator(): Traversable
2830
{
2931
return new ArrayIterator($this->rows);
3032
}
33+
/**
34+
* @psalm-suppress PossiblyUnusedMethod
35+
*/
3136
public function getQueryCounters(): ?ResultCounters
3237
{
3338
return $this->counters;
3439
}
35-
40+
/**
41+
* @psalm-suppress PossiblyUnusedMethod
42+
*/
3643
public function getProfiledQueryPlan(): ?ProfiledQueryPlan
3744
{
3845
return $this->profiledQueryPlan;
3946
}
40-
41-
public function getChildQueryPlan(): ?ChildQueryPlan
42-
{
43-
return $this->childQueryPlan;
44-
}
45-
47+
/**
48+
* @psalm-suppress PossiblyUnusedMethod
49+
*/
4650
public function count(): int
4751
{
4852
return count($this->rows);
4953
}
50-
54+
/**
55+
* @psalm-suppress PossiblyUnusedMethod
56+
*/
5157
public function getBookmarks(): ?Bookmarks
5258
{
5359
return $this->bookmarks;

0 commit comments

Comments
 (0)