Skip to content

Commit 75eb9d6

Browse files
authored
Merge pull request #144 from weslinkde/master
FIX: Adds multiple values as array instead of concatenation
2 parents bb6e825 + 40562bd commit 75eb9d6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/EDI/Analyser.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,14 @@ public function process(array $data, array $rawSegments = null): string
226226
$r[] = ' type: '.$d_sub_desc_attr['type'];
227227

228228
if (isset($jsoncomposite[$d_sub_desc_attr['name']])) {
229-
$jsoncomposite[$d_sub_desc_attr['name']] .= $d_detail;
229+
if (is_array($jsoncomposite[$d_sub_desc_attr['name']])) {
230+
$jsoncomposite[$d_sub_desc_attr['name']][] = $d_detail;
231+
} else {
232+
$jsoncomposite[$d_sub_desc_attr['name']] = [
233+
$jsoncomposite[$d_sub_desc_attr['name']],
234+
$d_detail
235+
];
236+
}
230237
} else {
231238
$jsoncomposite[$d_sub_desc_attr['name']] = $d_detail;
232239
}

0 commit comments

Comments
 (0)