Skip to content

Commit 5600d59

Browse files
authored
Merge pull request #61 from cuthbert/master
Interpreter leaves out repeating sub segments
2 parents b165444 + 765f5b8 commit 5600d59

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/EDI/Interpreter.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,13 @@ private function processSegment($segment, &$xmlMap, $segmentIdx, &$errors = null
300300
} else {
301301
$jsoncomposite = $detail;
302302
}
303-
$jsonelements[$d_desc_attr['name']] = $jsoncomposite;
303+
304+
if (array_key_exists($d_desc_attr['name'], $jsonelements)) {
305+
$jsonelements[$d_desc_attr['name'].$n] = $jsoncomposite;
306+
} else {
307+
$jsonelements[$d_desc_attr['name']] = $jsoncomposite;
308+
}
309+
304310
}
305311
$jsonsegment['key'] = $attributes['name'];
306312
$jsonsegment['value'] = $jsonelements;

0 commit comments

Comments
 (0)