Skip to content

Commit 5a8a957

Browse files
PratikshaPratiksha
authored andcommitted
DEBUG
1 parent 3c7635e commit 5a8a957

25 files changed

+139
-167
lines changed

src/AuthenticateInterface.php

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

55
use Psr\Http\Message\RequestInterface;
6-
6+
/**
7+
* @api
8+
*/
79
interface AuthenticateInterface
810
{
911
/**

src/BasicAuthentication.php

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

55
use Psr\Http\Message\RequestInterface;
6-
6+
/**
7+
* @api
8+
*/
79
class BasicAuthentication implements AuthenticateInterface
810
{
911
private string $username;

src/BearerAuthentication.php

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

55
use Psr\Http\Message\RequestInterface;
6-
6+
/**
7+
* @api
8+
*/
79
class BearerAuthentication implements AuthenticateInterface
810
{
911
public function __construct(private string $token)
@@ -16,17 +18,13 @@ public function authenticate(RequestInterface $request): RequestInterface
1618
return $request->withHeader('Authorization', $authHeader);
1719
}
1820

19-
/**
20-
* @psalm-suppress PossiblyUnusedMethod
21-
*/
21+
2222
public function getHeader(): string
2323
{
2424
return 'Bearer ' . $this->token;
2525
}
2626

27-
/**
28-
* @psalm-suppress PossiblyUnusedMethod
29-
*/
27+
3028
public function getType(): string
3129
{
3230
return 'Bearer';

src/Neo4jQueryAPI.php

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

33
namespace Neo4j\QueryAPI;
44

5+
use Exception;
56
use GuzzleHttp\Client;
67
use GuzzleHttp\Psr7\Request;
78
use GuzzleHttp\Psr7\Utils;
@@ -18,6 +19,9 @@
1819
use RuntimeException;
1920
use stdClass;
2021

22+
/**
23+
* @api
24+
*/
2125
class Neo4jQueryAPI
2226
{
2327
private ClientInterface $client;
@@ -30,10 +34,10 @@ public function __construct(ClientInterface $client, AuthenticateInterface $auth
3034
}
3135

3236
/**
33-
* @throws \Exception
37+
* @throws Exception
3438
*/
3539
/**
36-
* @psalm-suppress PossiblyUnusedMethod
40+
* @api
3741
*/
3842
public static function login(string $address, AuthenticateInterface $auth = null): self
3943
{
@@ -55,10 +59,6 @@ public static function login(string $address, AuthenticateInterface $auth = null
5559
* @throws Neo4jException
5660
* @throws RequestExceptionInterface
5761
*/
58-
59-
/**
60-
* @psalm-suppress PossiblyUnusedMethod
61-
*/
6262
public function run(string $cypher, array $parameters = [], string $database = 'neo4j', Bookmarks $bookmark = null): ResultSet
6363
{
6464
try {
@@ -163,9 +163,7 @@ private function handleException(RequestExceptionInterface $e): void
163163
throw $e;
164164
}
165165

166-
/**
167-
* @psalm-suppress PossiblyUnusedMethod
168-
*/
166+
169167
public function beginTransaction(): Transaction
170168
{
171169
$request = new Request('POST', '/db/neo4j/query/v2/tx');

src/Neo4jRequestFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
use Psr\Http\Message\RequestFactoryInterface;
66
use Psr\Http\Message\StreamFactoryInterface;
77
use Psr\Http\Message\RequestInterface;
8-
9-
/** @psalm-suppress UnusedClass */
8+
/**
9+
* @api
10+
*/
1011
class Neo4jRequestFactory
1112
{
1213
private string $baseUri;

src/NoAuth.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
use Psr\Http\Message\RequestInterface;
66

7+
/**
8+
* @api
9+
*/
710
class NoAuth implements AuthenticateInterface
811
{
912
public function authenticate(RequestInterface $request): RequestInterface
@@ -12,15 +15,3 @@ public function authenticate(RequestInterface $request): RequestInterface
1215
}
1316
}
1417

15-
/*
16-
namespace Neo4j\QueryAPI;
17-
18-
use Psr\Http\Message\RequestInterface;
19-
20-
class NoAuth implements AuthenticateInterface
21-
{
22-
public function authenticate(RequestInterface $request): RequestInterface
23-
{
24-
return $request;
25-
}
26-
}*/

src/OGM.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
use Neo4j\QueryAPI\Objects\Node;
77
use Neo4j\QueryAPI\Objects\Relationship;
88
use Neo4j\QueryAPI\Objects\Path;
9-
9+
/**
10+
* @api
11+
*/
1012
class OGM
1113
{
1214
/**

src/Objects/Authentication.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,33 @@
77
use Neo4j\QueryAPI\BasicAuthentication;
88
use Neo4j\QueryAPI\BearerAuthentication;
99
use Neo4j\QueryAPI\NoAuth;
10-
10+
/**
11+
* @api
12+
*/
1113
class Authentication
1214
{
1315
public static function basic(string $username, string $password): AuthenticateInterface
1416
{
1517
return new BasicAuthentication($username, $password);
1618
}
1719

18-
/**
19-
* @psalm-suppress PossiblyUnusedMethod
20-
*/
20+
2121
public static function fromEnvironment(): AuthenticateInterface
2222
{
23-
// Fetch credentials from environment variables
2423
$username = getenv("NEO4J_USERNAME") ?: '';
2524
$password = getenv("NEO4J_PASSWORD") ?: '';
2625

2726
return new BasicAuthentication($username, $password);
2827
}
2928

3029

31-
/**
32-
* @psalm-suppress PossiblyUnusedMethod
33-
*/
30+
3431
public static function noAuth(): AuthenticateInterface
3532
{
3633
return new NoAuth();
3734
}
3835

39-
/**
40-
* @psalm-suppress PossiblyUnusedMethod
41-
*/
36+
4237
public static function bearer(string $token): AuthenticateInterface
4338
{
4439
return new BearerAuthentication($token);

src/Objects/Node.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
/**
66
* Represents a Neo4j Node with labels and properties.
77
*/
8+
9+
/**
10+
* @api
11+
*/
812
class Node
913
{
1014
/**

src/Objects/Path.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
/**
66
* Represents a path in a Neo4j graph, consisting of nodes and relationships.
77
*/
8+
9+
/**
10+
* @api
11+
*/
812
class Path
913
{
1014
/**

0 commit comments

Comments
 (0)