Skip to content

Commit 788c191

Browse files
committed
fixed correct translation for iterables
1 parent dd19535 commit 788c191

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ParameterHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function asParameter($value, bool $boltDriver = false)
8484
self::emptySequenceToArray($value) ??
8585
self::convertBoltConvertibles($value, $boltDriver) ??
8686
self::convertTemporalTypes($value, $boltDriver) ??
87-
self::filledIterableToArray($value) ??
87+
self::filledIterableToArray($value, $boltDriver) ??
8888
self::stringAbleToString($value) ??
8989
self::filterInvalidType($value);
9090
}
@@ -158,10 +158,10 @@ private static function cypherMapToStdClass($value): ?stdClass
158158
/**
159159
* @param mixed $value
160160
*/
161-
private static function filledIterableToArray($value): ?array
161+
private static function filledIterableToArray($value, bool $boltDriver): ?array
162162
{
163163
if (is_iterable($value)) {
164-
return self::iterableToArray($value);
164+
return self::iterableToArray($value, $boltDriver);
165165
}
166166

167167
return null;
@@ -191,7 +191,7 @@ public static function formatParameters(iterable $parameters, bool $boltDriver =
191191
return new CypherMap($tbr);
192192
}
193193

194-
private static function iterableToArray(iterable $value): array
194+
private static function iterableToArray(iterable $value, bool $boltDriver): array
195195
{
196196
$tbr = [];
197197
/**
@@ -200,7 +200,7 @@ private static function iterableToArray(iterable $value): array
200200
*/
201201
foreach ($value as $key => $val) {
202202
if (is_int($key) || is_string($key)) {
203-
$tbr[$key] = self::asParameter($val);
203+
$tbr[$key] = self::asParameter($val, $boltDriver);
204204
} else {
205205
$msg = 'Iterable parameters must have an integer or string as key values, '.gettype($key).' received.';
206206
throw new InvalidArgumentException($msg);

0 commit comments

Comments
 (0)