private function loopMessage(array &$message, \SimpleXMLElement $xml, array &$errors): array
    {
        // init
        $groupedEdi = [];
        $segmentIdx = 0;

        foreach ($xml->children() as $elm) {
            if ($elm->getName() == "group") {
                $this->processXmlGroup($elm, $message, $segmentIdx, $groupedEdi, $errors);
            } elseif ($elm->getName() == "segment") {
                $this->processXmlSegment($elm, $message, $segmentIdx, $groupedEdi, $errors);
            }
        }

        if ($segmentIdx != \count($message)) {
            $errors[] = [
                "text" => $this->messageTextConf['NOTCONFORMANT'],
            ];
        }

        return ['message' => $groupedEdi, 'errors' => $errors];
    }
private function loopMessage(array &$message, \SimpleXMLElement $xml, array &$errors): array
    {
        // init
        $groupedEdi = [];
        $segmentIdx = 0;

        foreach ($xml->children() as $elm) {
            if ($elm->getName() == "group") {
                $this->processXmlGroup($elm, $message, $segmentIdx, $groupedEdi, $errors);
            } elseif ($elm->getName() == "segment") {
                $this->processXmlSegment($elm, $message, $segmentIdx, $groupedEdi, $errors);
            }
        }

        if ($segmentIdx != \count($message)) {
            $errors[] = [
                "text" => $this->messageTextConf['NOTCONFORMANT'],
            ];
        }

        return ['message' => $groupedEdi, 'errors' => $errors];
    }
private function loopMessage ( array & $ message , \ SimpleXMLElement $ xml , array & $ errors ) : array { // init $ groupedEdi = [ ] ; $ segmentIdx = 0 ; foreach ( $ xml -> children ( ) as $ elm ) { if ( $ elm -> getName ( ) == "group" ) { $ this -> processXmlGroup ( $ elm , $ message , $ segmentIdx , $ groupedEdi , $ errors ) ; } elseif ( $ elm -> getName ( ) == "segment" ) { $ this -> processXmlSegment ( $ elm , $ message , $ segmentIdx , $ groupedEdi , $ errors ) ; } } if ( $ segmentIdx != \ count ( $ message ) ) { $ errors [ ] = [ "text" => $ this -> messageTextConf [ 'NOTCONFORMANT' ] , ] ; } return [ 'message' => $ groupedEdi , 'errors' => $ errors ] ; }
Transform a parsed edi in its groupings

@param array             $message Single message (Without UNB and UNZ)
@param \SimpleXMLElement $xml     The xml representation of the message
@param array             $errors

@return array
Transform a parsed edi in its groupings