File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 29
29
30
30
final class ParameterHelper
31
31
{
32
+ /**
33
+ * @template T
34
+ *
35
+ * @param iterable<array-key, T> $iterable
36
+ *
37
+ * @return CypherList<T>
38
+ */
32
39
public static function asList (iterable $ iterable ): CypherList
33
40
{
34
41
return new CypherList (new Vector ($ iterable ));
35
42
}
36
43
44
+ /**
45
+ * @template T
46
+ *
47
+ * @param iterable<array-key, T> $iterable
48
+ *
49
+ * @return CypherMap<T>
50
+ */
37
51
public static function asMap (iterable $ iterable ): CypherMap
38
52
{
39
- return new CypherMap (new Map ($ iterable ));
53
+ /** @var Map<string, mixed> $map */
54
+ $ map = new Map ();
55
+ foreach ($ iterable as $ key => $ value ) {
56
+ $ map ->put ((string ) $ key , $ value );
57
+ }
58
+
59
+ return new CypherMap ($ map );
40
60
}
41
61
42
62
/**
You can’t perform that action at this time.
0 commit comments