Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ test
#PHP-CS-FIXER
.php-cs-fixer.php
.php-cs-fixer.cache


1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"require-dev": {
"phpunit/phpunit": "^11.0",
"friendsofphp/php-cs-fixer": "^3.68"

},
"autoload": {
"psr-4": {
Expand Down
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/BasicAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class BasicAuthentication implements AuthenticateInterface

public function __construct(?string $username = null, ?string $password = null)
{
// Use provided values or fallback to environment variables
$this->username = $username ?? getenv("NEO4J_USERNAME") ?: '';
$this->password = $password ?? getenv("NEO4J_PASSWORD") ?: '';
}
Expand Down
108 changes: 0 additions & 108 deletions src/Neo4jPhp.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/NoAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,3 @@ public function authenticate(RequestInterface $request): RequestInterface
return $request;
}
}

/*
namespace Neo4j\QueryAPI;

use Psr\Http\Message\RequestInterface;

class NoAuth implements AuthenticateInterface
{
public function authenticate(RequestInterface $request): RequestInterface
{
return $request;
}
}*/
12 changes: 6 additions & 6 deletions src/OGM.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class OGM
{
/**
* @param array{'$type': string, '_value': mixed} $object
* @param array{'$type': string, ' $object _value': mixed} $object
* @return mixed
*/
public function map(array $object): mixed
Expand All @@ -21,8 +21,8 @@ public function map(array $object): mixed
'String' => $object['_value'],
'Boolean' => $object['_value'],
'Null' => $object['_value'],
'Array' => $object['_value'], // Handle generic arrays
'List' => array_map([$this, 'map'], $object['_value']), // Recursively map lists
'Array' => $object['_value'],
'List' => array_map([$this, 'map'], $object['_value']),
'Duration' => $object['_value'],
'OffsetDateTime' => $object['_value'],
'Node' => $this->mapNode($object['_value']),
Expand All @@ -40,7 +40,7 @@ public static function parseWKT(string $wkt): Point
$srid = (int)str_replace('SRID=', '', $sridPart);

$pointPart = substr($wkt, strpos($wkt, 'POINT') + 6);
if (strpos($pointPart, 'Z') !== false) {
if (str_contains($pointPart, 'Z')) {
$pointPart = str_replace('Z', '', $pointPart);
}
$pointPart = trim($pointPart, ' ()');
Expand All @@ -64,8 +64,8 @@ public static function parseWKT(string $wkt): Point
private function mapNode(array $nodeData): Node
{
return new Node(
$nodeData['_labels'], // Labels of the node
$this->mapProperties($nodeData['_properties']) // Mapped properties
$nodeData['_labels'],
$this->mapProperties($nodeData['_properties'])
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static function basic(string $username, string $password): AuthenticateIn

public static function fromEnvironment(): AuthenticateInterface
{
// Fetch credentials from environment variables

$username = getenv("NEO4J_USERNAME") ?: '';
$password = getenv("NEO4J_PASSWORD") ?: '';

Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Person extends Node
*/
public function __construct(array $properties)
{
// Pass the label 'Person' along with the properties to the parent Node constructor.

parent::__construct(['Person'], $properties);
}
}
2 changes: 1 addition & 1 deletion src/Objects/ProfiledQueryPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
?string $operatorType,
ProfiledQueryPlanArguments $arguments,
?array $children = [],
array $identifiers = [] // Default to an empty array
array $identifiers = []
) {
$this->dbHits = $dbHits ?? 0;
$this->records = $records ?? 0;
Expand Down
2 changes: 0 additions & 2 deletions src/Objects/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use Neo4j\QueryAPI\Results\ResultRow;
use Traversable;

// Make sure to include the Bookmarks class

class ResultSet implements IteratorAggregate, Countable
{
/**
Expand Down
5 changes: 3 additions & 2 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Neo4j\QueryAPI;

use GuzzleHttp\Exception\GuzzleException;
use Neo4j\QueryAPI\Exception\Neo4jException;
use Neo4j\QueryAPI\Objects\Authentication;
use Neo4j\QueryAPI\Objects\Bookmarks;
Expand All @@ -22,11 +23,11 @@ public function __construct(

/**
* Execute a Cypher query within the transaction.
* @api
* @param string $query The Cypher query to be executed.
* @param array $parameters Parameters for the query.
* @return ResultSet The result rows in ResultSet format.
* @throws Neo4jException If the response structure is invalid.
* @throws Neo4jException|GuzzleException If the response structure is invalid.
*@api
*/
public function run(string $query, array $parameters): ResultSet
{
Expand Down
67 changes: 0 additions & 67 deletions src/requestFactory.php

This file was deleted.

Loading