Skip to content

Commit c2585d9

Browse files
committed
cleaning up
1 parent e9a252b commit c2585d9

File tree

5 files changed

+13
-26
lines changed

5 files changed

+13
-26
lines changed

src/Neo4jRequestFactory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
use Psr\Http\Message\RequestInterface;
99
use Psr\Http\Message\StreamFactoryInterface;
1010

11-
/**
12-
* @api
13-
*/
1411
class Neo4jRequestFactory
1512
{
1613
public function __construct(

src/OGM.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
use Neo4j\QueryAPI\Objects\Path;
99
use InvalidArgumentException;
1010

11-
/**
12-
* @api
13-
*/
1411
class OGM
1512
{
1613
/**
@@ -57,14 +54,14 @@ 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
}

src/Objects/Node.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ public function __construct(array $labels, array $properties)
3030
$this->properties = $properties;
3131
}
3232

33-
/**
34-
* Get the labels of the node.
35-
* @return string[] Array of labels.
36-
*/
37-
public function getLabels(): array
38-
{
39-
return $this->labels;
40-
}
41-
4233
/**
4334
* Get the properties of the node.
4435
* @return array<string, mixed> Associative array of properties.

src/Results/ResultSet.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Traversable;
1313

1414
/**
15-
* @api
1615
* @template TValue
1716
* @implements IteratorAggregate<int, ResultRow>
1817
*/

tests/Integration/Neo4jOGMTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
use Neo4j\QueryAPI\OGM;
66
use PHPUnit\Framework\TestCase;
77

8-
final class Neo4jOGMTest extends TestCase
8+
/**
9+
* @api
10+
*/
11+
class Neo4jOGMTest extends TestCase
912
{
13+
/** @psalm-suppress PropertyNotSetInConstructor */
1014
private OGM $ogm;
1115

1216
#[\Override]
@@ -31,9 +35,9 @@ public function testWithNode(): void
3135
$this->assertEquals('Ayush', $node->getProperties()['name']['_value']);
3236
}
3337

34-
3538
public function testWithSimpleRelationship(): void
3639
{
40+
3741
$relationshipData = [
3842
'$type' => 'Relationship',
3943
'_value' => [
@@ -43,10 +47,9 @@ public function testWithSimpleRelationship(): void
4347
];
4448

4549
$relationship = $this->ogm->map($relationshipData);
46-
$this->assertEquals('FRIENDS', $relationship->getType());
50+
$this->assertEquals('FRIENDS', $relationship->type);
4751
}
4852

49-
// More tests...
5053
public function testWithPath(): void
5154
{
5255
$pathData = [
@@ -82,10 +85,10 @@ public function testWithPath(): void
8285

8386
$path = $this->ogm->map($pathData);
8487

85-
$this->assertCount(2, $path->getNodes());
86-
$this->assertCount(1, $path->getRelationships());
87-
$this->assertEquals('A', $path->getNodes()[0]->getProperties()['name']['_value']);
88-
$this->assertEquals('B', $path->getNodes()[1]->getProperties()['name']['_value']);
88+
$this->assertCount(2, $path->nodes);
89+
$this->assertCount(1, $path->relationships);
90+
$this->assertEquals('A', $path->nodes[0]->getProperties()['name']['_value']);
91+
$this->assertEquals('B', $path->nodes[1]->getProperties()['name']['_value']);
8992
}
9093

9194
}

0 commit comments

Comments
 (0)