@@ -32,12 +32,15 @@ class UnboundRelationship extends AbstractPropertyObject
32
32
/**
33
33
* @param CypherMap<OGMTypes> $properties
34
34
*/
35
+ private string $elementId;
36
+
35
37
public function __construct(
36
38
private readonly int $id,
37
39
private readonly string $type,
38
40
private readonly CypherMap $properties,
39
- private readonly ?string $elementId,
41
+ ?string $elementId = null ,
40
42
) {
43
+ $this->elementId = $elementId ?? (string) $id;
41
44
}
42
45
43
46
public function getElementId(): ?string
@@ -55,6 +58,9 @@ public function getType(): string
55
58
return $this->type;
56
59
}
57
60
61
+ /**
62
+ * @psalm-suppress MixedReturnTypeCoercion
63
+ */
58
64
public function getProperties(): CypherMap
59
65
{
60
66
/** @psalm-suppress InvalidReturnStatement false positive with type alias. */
@@ -80,7 +86,11 @@ public function toArray(): array
80
86
*
81
87
* @return OGMTypes
82
88
*/
83
- public function getProperty(string $key)
89
+
90
+ /**
91
+ * @psalm-suppress MixedReturnStatement
92
+ */
93
+ public function getProperty(string $key): string
84
94
{
85
95
/** @psalm-suppress ImpureMethodCall */
86
96
if (!$this->properties->hasKey($key)) {
0 commit comments