10
10
class OGM
11
11
{
12
12
/**
13
- * @param array{'$type': string, '_value': mixed} $object
13
+ * @param array{'$type': string, ' $object _value': mixed} $object
14
14
* @return mixed
15
15
*/
16
16
public function map (array $ object ): mixed
@@ -21,8 +21,8 @@ public function map(array $object): mixed
21
21
'String ' => $ object ['_value ' ],
22
22
'Boolean ' => $ object ['_value ' ],
23
23
'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 ' ]),
26
26
'Duration ' => $ object ['_value ' ],
27
27
'OffsetDateTime ' => $ object ['_value ' ],
28
28
'Node ' => $ this ->mapNode ($ object ['_value ' ]),
@@ -40,7 +40,7 @@ public static function parseWKT(string $wkt): Point
40
40
$ srid = (int )str_replace ('SRID= ' , '' , $ sridPart );
41
41
42
42
$ pointPart = substr ($ wkt , strpos ($ wkt , 'POINT ' ) + 6 );
43
- if (strpos ($ pointPart , 'Z ' ) !== false ) {
43
+ if (str_contains ($ pointPart , 'Z ' )) {
44
44
$ pointPart = str_replace ('Z ' , '' , $ pointPart );
45
45
}
46
46
$ pointPart = trim ($ pointPart , ' () ' );
@@ -64,8 +64,8 @@ public static function parseWKT(string $wkt): Point
64
64
private function mapNode (array $ nodeData ): Node
65
65
{
66
66
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 ' ])
69
69
);
70
70
}
71
71
0 commit comments