Skip to content

Commit b4e0799

Browse files
PratikshaPratiksha
authored andcommitted
winp
1 parent 45386e6 commit b4e0799

14 files changed

+45
-332
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ test
1313
#PHP-CS-FIXER
1414
.php-cs-fixer.php
1515
.php-cs-fixer.cache
16+
17+

src/Neo4jPhp.php

Lines changed: 0 additions & 108 deletions
This file was deleted.

src/NoAuth.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,4 @@ public function authenticate(RequestInterface $request): RequestInterface
1212
}
1313
}
1414

15-
/*
16-
namespace Neo4j\QueryAPI;
17-
18-
use Psr\Http\Message\RequestInterface;
1915

20-
class NoAuth implements AuthenticateInterface
21-
{
22-
public function authenticate(RequestInterface $request): RequestInterface
23-
{
24-
return $request;
25-
}
26-
}*/

src/OGM.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class OGM
1111
{
1212
/**
13-
* @param array{'$type': string, '_value': mixed} $object
13+
* @param array{'$type': string, ' $object _value': mixed} $object
1414
* @return mixed
1515
*/
1616
public function map(array $object): mixed
@@ -21,8 +21,8 @@ public function map(array $object): mixed
2121
'String' => $object['_value'],
2222
'Boolean' => $object['_value'],
2323
'Null' => $object['_value'],
24-
'Array' => $object['_value'], // Handle generic arrays
25-
'List' => array_map([$this, 'map'], $object['_value']), // Recursively map lists
24+
'Array' => $object['_value'],
25+
'List' => array_map([$this, 'map'], $object['_value']),
2626
'Duration' => $object['_value'],
2727
'OffsetDateTime' => $object['_value'],
2828
'Node' => $this->mapNode($object['_value']),
@@ -40,7 +40,7 @@ public static function parseWKT(string $wkt): Point
4040
$srid = (int)str_replace('SRID=', '', $sridPart);
4141

4242
$pointPart = substr($wkt, strpos($wkt, 'POINT') + 6);
43-
if (strpos($pointPart, 'Z') !== false) {
43+
if (str_contains($pointPart, 'Z')) {
4444
$pointPart = str_replace('Z', '', $pointPart);
4545
}
4646
$pointPart = trim($pointPart, ' ()');
@@ -64,8 +64,8 @@ public static function parseWKT(string $wkt): Point
6464
private function mapNode(array $nodeData): Node
6565
{
6666
return new Node(
67-
$nodeData['_labels'], // Labels of the node
68-
$this->mapProperties($nodeData['_properties']) // Mapped properties
67+
$nodeData['_labels'],
68+
$this->mapProperties($nodeData['_properties'])
6969
);
7070
}
7171

src/Objects/Authentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static function basic(string $username, string $password): AuthenticateIn
1717

1818
public static function fromEnvironment(): AuthenticateInterface
1919
{
20-
// Fetch credentials from environment variables
20+
2121
$username = getenv("NEO4J_USERNAME") ?: '';
2222
$password = getenv("NEO4J_PASSWORD") ?: '';
2323

src/Objects/ProfiledQueryPlan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(
3535
?string $operatorType,
3636
ProfiledQueryPlanArguments $arguments,
3737
?array $children = [],
38-
array $identifiers = [] // Default to an empty array
38+
array $identifiers = []
3939
) {
4040
$this->dbHits = $dbHits ?? 0;
4141
$this->records = $records ?? 0;

src/Objects/ResultSet.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Neo4j\QueryAPI\Results\ResultRow;
99
use Traversable;
1010

11-
// Make sure to include the Bookmarks class
1211

1312
class ResultSet implements IteratorAggregate, Countable
1413
{

src/Transaction.php

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

33
namespace Neo4j\QueryAPI;
44

5+
use GuzzleHttp\Exception\GuzzleException;
56
use Neo4j\QueryAPI\Exception\Neo4jException;
67
use Neo4j\QueryAPI\Objects\Authentication;
78
use Neo4j\QueryAPI\Objects\Bookmarks;
@@ -22,11 +23,11 @@ public function __construct(
2223

2324
/**
2425
* Execute a Cypher query within the transaction.
25-
* @api
2626
* @param string $query The Cypher query to be executed.
2727
* @param array $parameters Parameters for the query.
2828
* @return ResultSet The result rows in ResultSet format.
29-
* @throws Neo4jException If the response structure is invalid.
29+
* @throws Neo4jException|GuzzleException If the response structure is invalid.
30+
*@api
3031
*/
3132
public function run(string $query, array $parameters): ResultSet
3233
{

src/requestFactory.php

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/transaction_Script.php

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)