Skip to content

Commit 0239aa3

Browse files
committed
keep type as is
1 parent 7f4712b commit 0239aa3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/EDI/Interpreter.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ class Interpreter
9191
private $serviceSeg;
9292

9393
/**
94-
* @var array|null
94+
* @var array
9595
*/
96-
private $codes = null;
96+
private $codes;
9797

9898
/**
9999
* @var callable
@@ -797,7 +797,7 @@ private function processSegment(array &$segment, array &$xmlMap, $segmentIdx, ?a
797797
//print_r($d_sub_desc_attr);
798798
//print_r($d_detail);
799799
//die();
800-
if ($this->codes !== null && isset($this->codes[$d_sub_desc_attr['id']]) && is_array($this->codes[$d_sub_desc_attr['id']])) { //if codes is set enable translation of the value
800+
if (isset($this->codes) && isset($this->codes[$d_sub_desc_attr['id']]) && is_array($this->codes[$d_sub_desc_attr['id']])) { //if codes is set enable translation of the value
801801
if (isset($this->codes[$d_sub_desc_attr['id']][$d_detail])) {
802802
$d_detail = $this->codes[$d_sub_desc_attr['id']][$d_detail];
803803
}
@@ -817,15 +817,15 @@ private function processSegment(array &$segment, array &$xmlMap, $segmentIdx, ?a
817817
} else {
818818
$d_sub_desc_attr = $sub_details_desc[0]['attributes'];
819819

820-
if ($this->codes !== null && isset($this->codes[$d_sub_desc_attr['id']]) && is_array($this->codes[$d_sub_desc_attr['id']])) { //if codes is set enable translation of the value
820+
if (isset($this->codes) && isset($this->codes[$d_sub_desc_attr['id']]) && is_array($this->codes[$d_sub_desc_attr['id']])) { //if codes is set enable translation of the value
821821
if (isset($this->codes[$d_sub_desc_attr['id']][$detail]) && $this->codes[$d_sub_desc_attr['id']][$detail]) {
822822
$detail = $this->codes[$d_sub_desc_attr['id']][$detail];
823823
}
824824
}
825825
$jsoncomposite[$d_sub_desc_attr[$this->outputKey]] = $detail;
826826
}
827827
} else {
828-
if ($this->codes !== null && isset($this->codes[$d_desc_attr['id']]) && is_array($this->codes[$d_desc_attr['id']])) { //if codes is set enable translation of the value
828+
if (isset($this->codes) && isset($this->codes[$d_desc_attr['id']]) && is_array($this->codes[$d_desc_attr['id']])) { //if codes is set enable translation of the value
829829
if (isset($this->codes[$d_desc_attr['id']][$detail]) && $this->codes[$d_desc_attr['id']][$detail]) {
830830
$detail = $this->codes[$d_desc_attr['id']][$detail];
831831
}
@@ -869,7 +869,7 @@ private function processService(array &$segments): array
869869

870870
public function rebuildArray()
871871
{
872-
if ($this->codes !== null) {
872+
if (isset($this->codes)) {
873873
throw new \LogicException('Run the Interpreter without calling setCodes()');
874874
}
875875
$unh = $this->serviceSeg['interchangeHeader'];

0 commit comments

Comments
 (0)