Skip to content

Commit fba075f

Browse files
p123-stackPratiksha
andauthored
Cleanup for excessive comments and unnecessary files (#17)
Co-authored-by: Pratiksha <pratiksha@Pratiksha-Nagels>
1 parent 45386e6 commit fba075f

20 files changed

+59
-367
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+

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"require-dev": {
1313
"phpunit/phpunit": "^11.0",
1414
"friendsofphp/php-cs-fixer": "^3.68"
15+
1516
},
1617
"autoload": {
1718
"psr-4": {

composer.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/BasicAuthentication.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class BasicAuthentication implements AuthenticateInterface
1111

1212
public function __construct(?string $username = null, ?string $password = null)
1313
{
14-
// Use provided values or fallback to environment variables
1514
$this->username = $username ?? getenv("NEO4J_USERNAME") ?: '';
1615
$this->password = $password ?? getenv("NEO4J_PASSWORD") ?: '';
1716
}

src/Neo4jPhp.php

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

src/NoAuth.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,3 @@ public function authenticate(RequestInterface $request): RequestInterface
1111
return $request;
1212
}
1313
}
14-
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: 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/Person.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Person extends Node
1515
*/
1616
public function __construct(array $properties)
1717
{
18-
// Pass the label 'Person' along with the properties to the parent Node constructor.
18+
1919
parent::__construct(['Person'], $properties);
2020
}
2121
}

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;

0 commit comments

Comments
 (0)