Skip to content

Commit 40a8d3f

Browse files
committed
add \Traversable support
1 parent 78c300e commit 40a8d3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/MultipleInput.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ protected function initData()
254254
return;
255255
}
256256

257-
foreach ((array) $data as $index => $value) {
257+
if (!($data instanceof \Traversable)) {
258+
$data = (array) $data;
259+
}
260+
261+
foreach ($data as $index => $value) {
258262
$this->data[$index] = $value;
259263
}
260264
}

0 commit comments

Comments
 (0)