Skip to content

Commit 7027455

Browse files
PratikshaPratiksha
authored andcommitted
DEBUG
1 parent 5a8a957 commit 7027455

21 files changed

+66
-75
lines changed

src/AuthenticateInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Neo4j\QueryAPI;
44

55
use Psr\Http\Message\RequestInterface;
6+
67
/**
78
* @api
89
*/

src/BasicAuthentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Neo4j\QueryAPI;
44

55
use Psr\Http\Message\RequestInterface;
6+
67
/**
78
* @api
89
*/
@@ -13,7 +14,6 @@ class BasicAuthentication implements AuthenticateInterface
1314

1415
public function __construct(?string $username = null, ?string $password = null)
1516
{
16-
// Use provided values or fallback to environment variables
1717
$this->username = $username ?? getenv("NEO4J_USERNAME") ?: '';
1818
$this->password = $password ?? getenv("NEO4J_PASSWORD") ?: '';
1919
}

src/BearerAuthentication.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Neo4j\QueryAPI;
44

55
use Psr\Http\Message\RequestInterface;
6+
67
/**
78
* @api
89
*/
@@ -18,13 +19,13 @@ public function authenticate(RequestInterface $request): RequestInterface
1819
return $request->withHeader('Authorization', $authHeader);
1920
}
2021

21-
22+
2223
public function getHeader(): string
2324
{
2425
return 'Bearer ' . $this->token;
2526
}
2627

27-
28+
2829
public function getType(): string
2930
{
3031
return 'Bearer';

src/Neo4jQueryAPI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private function handleException(RequestExceptionInterface $e): void
163163
throw $e;
164164
}
165165

166-
166+
167167
public function beginTransaction(): Transaction
168168
{
169169
$request = new Request('POST', '/db/neo4j/query/v2/tx');

src/Neo4jRequestFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Psr\Http\Message\RequestFactoryInterface;
66
use Psr\Http\Message\StreamFactoryInterface;
77
use Psr\Http\Message\RequestInterface;
8+
89
/**
910
* @api
1011
*/

src/NoAuth.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ public function authenticate(RequestInterface $request): RequestInterface
1414
return $request;
1515
}
1616
}
17-

src/OGM.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Neo4j\QueryAPI\Objects\Node;
77
use Neo4j\QueryAPI\Objects\Relationship;
88
use Neo4j\QueryAPI\Objects\Path;
9+
910
/**
1011
* @api
1112
*/
@@ -23,8 +24,8 @@ public function map(array $object): mixed
2324
'String' => $object['_value'],
2425
'Boolean' => $object['_value'],
2526
'Null' => $object['_value'],
26-
'Array' => $object['_value'], // Handle generic arrays
27-
'List' => array_map([$this, 'map'], $object['_value']), // Recursively map lists
27+
'Array' => $object['_value'],
28+
'List' => array_map([$this, 'map'], $object['_value']),
2829
'Duration' => $object['_value'],
2930
'OffsetDateTime' => $object['_value'],
3031
'Node' => $this->mapNode($object['_value']),

src/Objects/Authentication.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Neo4j\QueryAPI\BasicAuthentication;
88
use Neo4j\QueryAPI\BearerAuthentication;
99
use Neo4j\QueryAPI\NoAuth;
10+
1011
/**
1112
* @api
1213
*/
@@ -17,7 +18,7 @@ public static function basic(string $username, string $password): AuthenticateIn
1718
return new BasicAuthentication($username, $password);
1819
}
1920

20-
21+
2122
public static function fromEnvironment(): AuthenticateInterface
2223
{
2324
$username = getenv("NEO4J_USERNAME") ?: '';
@@ -27,13 +28,13 @@ public static function fromEnvironment(): AuthenticateInterface
2728
}
2829

2930

30-
31+
3132
public static function noAuth(): AuthenticateInterface
3233
{
3334
return new NoAuth();
3435
}
3536

36-
37+
3738
public static function bearer(string $token): AuthenticateInterface
3839
{
3940
return new BearerAuthentication($token);

src/Objects/Person.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Person extends Node
1818
*/
1919
public function __construct(array $properties)
2020
{
21-
// Pass the label 'Person' along with the properties to the parent Node constructor.
2221
parent::__construct(['Person'], $properties);
2322
}
2423
}

src/Objects/ProfiledQueryPlan.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
namespace Neo4j\QueryAPI\Objects;
4+
45
/**
56
* @api
67
*/
@@ -37,7 +38,7 @@ public function __construct(
3738
?string $operatorType,
3839
ProfiledQueryPlanArguments $arguments,
3940
?array $children = [],
40-
array $identifiers = [] // Default to an empty array
41+
array $identifiers = []
4142
) {
4243
$this->dbHits = $dbHits ?? 0;
4344
$this->records = $records ?? 0;
@@ -51,50 +52,50 @@ public function __construct(
5152
$this->children = $children ?? [];
5253
$this->identifiers = $identifiers;
5354
}
54-
55+
5556
public function getDbHits(): int
5657
{
5758
return $this->dbHits;
5859
}
59-
60+
6061
public function getRecords(): int
6162
{
6263
return $this->records;
6364
}
6465

65-
66+
6667
public function hasPageCacheStats(): bool
6768
{
6869
return $this->hasPageCacheStats;
6970
}
70-
71+
7172
public function getPageCacheHits(): int
7273
{
7374
return $this->pageCacheHits;
7475
}
75-
76+
7677

7778
public function getPageCacheMisses(): int
7879
{
7980
return $this->pageCacheMisses;
8081
}
81-
82+
8283
public function getPageCacheHitRatio(): float
8384
{
8485
return $this->pageCacheHitRatio;
8586
}
86-
87+
8788

8889
public function getTime(): int
8990
{
9091
return $this->time;
9192
}
92-
93+
9394
public function getOperatorType(): string
9495
{
9596
return $this->operatorType;
9697
}
97-
98+
9899
public function getArguments(): ProfiledQueryPlanArguments
99100
{
100101
return $this->arguments;
@@ -104,7 +105,7 @@ public function getArguments(): ProfiledQueryPlanArguments
104105
* @return list<ProfiledQueryPlan|ProfiledQueryPlanArguments>
105106
*/
106107

107-
108+
108109
public function getChildren(): array
109110
{
110111
return $this->children;
@@ -118,7 +119,7 @@ public function addChild(ProfiledQueryPlan|ProfiledQueryPlanArguments $child): v
118119
/**
119120
* @return string[]
120121
*/
121-
122+
122123
public function getIdentifiers(): array
123124
{
124125
return $this->identifiers;
@@ -127,13 +128,13 @@ public function getIdentifiers(): array
127128
/**
128129
* @param string[] $identifiers
129130
*/
130-
131+
131132
public function setIdentifiers(array $identifiers): void
132133
{
133134
$this->identifiers = $identifiers;
134135
}
135136

136-
137+
137138
public function addIdentifier(string $identifier): void
138139
{
139140
$this->identifiers[] = $identifier;

0 commit comments

Comments
 (0)