From 6f3406cc355bff539166e1145082c101671c1107 Mon Sep 17 00:00:00 2001 From: Junmar Jose Date: Tue, 16 Apr 2024 16:26:22 +0200 Subject: [PATCH] fix: concatenation of details instead of overwrite if its the same attribute --- src/EDI/Analyser.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/EDI/Analyser.php b/src/EDI/Analyser.php index 6da3732..d33d46e 100644 --- a/src/EDI/Analyser.php +++ b/src/EDI/Analyser.php @@ -223,7 +223,12 @@ public function process(array $data, array $rawSegments = null): string $r[] = ' '.\wordwrap($d_sub_desc_attr['desc'], 69, \PHP_EOL.' '); $r[] = ' type: '.$d_sub_desc_attr['type']; - $jsoncomposite[$d_sub_desc_attr['name']] = $d_detail; + if (isset($jsoncomposite[$d_sub_desc_attr['name']])) { + $jsoncomposite[$d_sub_desc_attr['name']] .= $d_detail; + } else { + $jsoncomposite[$d_sub_desc_attr['name']] = $d_detail; + } + if (isset($d_sub_desc_attr['maxlength'])) { $r[] = ' maxlen: '.$d_sub_desc_attr['maxlength']; }