Skip to content

Commit 3530845

Browse files
committed
temp commit
1 parent aca7566 commit 3530845

29 files changed

+75
-311
lines changed

src/Authentication/AuthenticateInterface.php

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

55
use Psr\Http\Message\RequestInterface;
66

7-
/**
8-
* @api
9-
*/
107
interface AuthenticateInterface
118
{
129
public function getHeader(): string;

src/Authentication/BasicAuthentication.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
use Psr\Http\Message\RequestInterface;
66

7-
/**
8-
* @api
9-
*/
10-
class BasicAuthentication implements AuthenticateInterface
7+
final class BasicAuthentication implements AuthenticateInterface
118
{
129
private string $username;
1310
private string $password;

src/Authentication/BearerAuthentication.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
use Psr\Http\Message\RequestInterface;
66

7-
/**
8-
* @api
9-
*/
10-
class BearerAuthentication implements AuthenticateInterface
7+
final class BearerAuthentication implements AuthenticateInterface
118
{
129
public function __construct(private string $token)
1310
{

src/Authentication/NoAuth.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
use Psr\Http\Message\RequestInterface;
66

7-
/**
8-
* @api
9-
*/
10-
class NoAuth implements AuthenticateInterface
7+
final class NoAuth implements AuthenticateInterface
118
{
129
#[\Override]
1310
public function getHeader(): string

src/Exception/Neo4jException.php

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44

55
use Exception;
66

7-
/**
8-
* @api
9-
*/
10-
class Neo4jException extends Exception
7+
final class Neo4jException extends Exception
118
{
12-
private readonly string $errorCode;
13-
private readonly ?string $errorType;
14-
private readonly ?string $errorSubType;
15-
private readonly ?string $errorName;
9+
public readonly string $errorCode;
10+
public readonly ?string $errorType;
11+
public readonly ?string $errorSubType;
12+
public readonly ?string $errorName;
1613

1714
public function __construct(
1815
array $errorDetails = [],
@@ -31,7 +28,6 @@ public function __construct(
3128

3229
/**
3330
* Create a Neo4jException instance from a Neo4j error response array.
34-
*
3531
* @param array $response The error response from Neo4j.
3632
* @param \Throwable|null $exception Optional previous exception for chaining.
3733
* @return self
@@ -44,23 +40,4 @@ public static function fromNeo4jResponse(array $response, ?\Throwable $exception
4440
return new self($errorDetails, previous: $exception);
4541
}
4642

47-
public function getErrorCode(): string
48-
{
49-
return $this->errorCode;
50-
}
51-
52-
public function getType(): ?string
53-
{
54-
return $this->errorType;
55-
}
56-
57-
public function getSubType(): ?string
58-
{
59-
return $this->errorSubType;
60-
}
61-
62-
public function getName(): ?string
63-
{
64-
return $this->errorName;
65-
}
6643
}

src/Neo4jQueryAPI.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ public function __construct(
2222
) {
2323
}
2424

25-
/**
26-
* @api
27-
*/
2825
public static function login(string $address, AuthenticateInterface $auth = null): self
2926
{
3027
$client = Psr18ClientDiscovery::find();

src/Neo4jRequestFactory.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
use Psr\Http\Message\RequestInterface;
99
use Psr\Http\Message\StreamFactoryInterface;
1010

11-
/**
12-
* @api
13-
*/
14-
class Neo4jRequestFactory
11+
final class Neo4jRequestFactory
1512
{
1613
public function __construct(
1714
private RequestFactoryInterface $psr17Factory,

src/OGM.php

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
use Neo4j\QueryAPI\Objects\Path;
99
use InvalidArgumentException;
1010

11-
/**
12-
* @api
13-
*/
14-
class OGM
11+
final class OGM
1512
{
1613
/**
1714
* @param array<array-key, mixed> $data
@@ -57,44 +54,18 @@ private function mapNode(array $nodeData): Node
5754
{
5855
return new Node(
5956
labels: $nodeData['_labels'] ?? [],
60-
properties: $this->mapProperties($nodeData['_properties'] ?? []) // ✅ Fix: Ensure properties exist
57+
properties: $this->mapProperties($nodeData['_properties'] ?? [])
6158
);
6259
}
6360

6461
private function mapRelationship(array $relationshipData): Relationship
6562
{
6663
return new Relationship(
67-
type: $relationshipData['_type'] ?? 'UNKNOWN', // ✅ Fix: Default to 'UNKNOWN'
64+
type: $relationshipData['_type'] ?? 'UNKNOWN',
6865
properties: $this->mapProperties($relationshipData['_properties'] ?? [])
6966
);
7067
}
7168

72-
73-
public static function parseWKT(string $wkt): Point
74-
{
75-
$sridPos = strpos($wkt, ';');
76-
if ($sridPos === false) {
77-
throw new \InvalidArgumentException("Invalid WKT format: missing ';'");
78-
}
79-
$sridPart = substr($wkt, 0, $sridPos);
80-
$srid = (int)str_replace('SRID=', '', $sridPart);
81-
82-
$pointPos = strpos($wkt, 'POINT');
83-
if ($pointPos === false) {
84-
throw new \InvalidArgumentException("Invalid WKT format: missing 'POINT'");
85-
}
86-
$pointPart = substr($wkt, $pointPos + 6);
87-
88-
$pointPart = str_replace('Z', '', $pointPart);
89-
$pointPart = trim($pointPart, ' ()');
90-
$coordinates = explode(' ', $pointPart);
91-
92-
[$x, $y, $z] = array_pad(array_map('floatval', $coordinates), 3, 0.0);
93-
94-
return new Point($x, $y, $z, $srid);
95-
}
96-
97-
9869
private function mapPath(array $pathData): Path
9970
{
10071
$nodes = [];

src/Objects/Authentication.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
use Neo4j\QueryAPI\Authentication\BearerAuthentication;
88
use Neo4j\QueryAPI\Authentication\NoAuth;
99

10-
/**
11-
* @api
12-
*/
13-
class Authentication
10+
final class Authentication
1411
{
1512
public static function basic(string $username, string $password): AuthenticateInterface
1613
{

src/Objects/Bookmarks.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
use JsonSerializable;
66

7-
/**
8-
* @api
9-
*/
10-
class Bookmarks implements \Countable, JsonSerializable
7+
final class Bookmarks implements \Countable, JsonSerializable
118
{
129
public function __construct(private array $bookmarks)
1310
{

0 commit comments

Comments
 (0)