public function prepare(array $parsed): array
    {
        $this->msgs = $this->splitMessages($parsed, $this->errors);
        $groups = [];
        $service = $this->msgs['service'];
        $this->serviceSeg = $this->processService($service);

        foreach ($this->msgs as $k => $msg) {
            if ($k === 'service') {
                continue;
            }
            $grouped = $this->loopMessage($msg, $this->xmlMsg, $this->errors);
            $groups[] = $grouped['message'];
        }
        $this->ediGroups = $groups;

        return $groups;
    }
public function prepare(array $parsed): array
    {
        $this->msgs = $this->splitMessages($parsed, $this->errors);
        $groups = [];
        $service = $this->msgs['service'];
        $this->serviceSeg = $this->processService($service);

        foreach ($this->msgs as $k => $msg) {
            if ($k === 'service') {
                continue;
            }
            $grouped = $this->loopMessage($msg, $this->xmlMsg, $this->errors);
            $groups[] = $grouped['message'];
        }
        $this->ediGroups = $groups;

        return $groups;
    }
public function prepare ( array $ parsed ) : array { $ this -> msgs = $ this -> splitMessages ( $ parsed , $ this -> errors ) ; $ groups = [ ] ; $ service = $ this -> msgs [ 'service' ] ; $ this -> serviceSeg = $ this -> processService ( $ service ) ; foreach ( $ this -> msgs as $ k => $ msg ) { if ( $ k === 'service' ) { continue ; } $ grouped = $ this -> loopMessage ( $ msg , $ this -> xmlMsg , $ this -> errors ) ; $ groups [ ] = $ grouped [ 'message' ] ; } $ this -> ediGroups = $ groups ; return $ groups ; }
Split multiple messages and process

@param array $parsed An array coming from EDI\Parser

@return array
Split multiple messages and process