protected function parseBody($stream, $uid)
    {
        $struct = imap_fetchstructure($stream, $uid, static::$fetchFlags);

        if (!isset($struct->parts)) {
            return array_filter([$this->parsePart($stream, $uid, $struct)]);
        }

        $parsedParts = [];
        foreach ($this->flattenParts($struct->parts) as $partNo => $part) {
            $parsedParts[] = $this->parsePart($stream, $uid, $part, $partNo);
        }
        return array_filter($parsedParts);
    }
protected function parseBody($stream, $uid)
    {
        $struct = imap_fetchstructure($stream, $uid, static::$fetchFlags);

        if (!isset($struct->parts)) {
            return array_filter([$this->parsePart($stream, $uid, $struct)]);
        }

        $parsedParts = [];
        foreach ($this->flattenParts($struct->parts) as $partNo => $part) {
            $parsedParts[] = $this->parsePart($stream, $uid, $part, $partNo);
        }
        return array_filter($parsedParts);
    }
protected function parseBody ( $ stream , $ uid ) { $ struct = imap_fetchstructure ( $ stream , $ uid , static :: $ fetchFlags ) ; if ( ! isset ( $ struct -> parts ) ) { return array_filter ( [ $ this -> parsePart ( $ stream , $ uid , $ struct ) ] ) ; } $ parsedParts = [ ] ; foreach ( $ this -> flattenParts ( $ struct -> parts ) as $ partNo => $ part ) { $ parsedParts [ ] = $ this -> parsePart ( $ stream , $ uid , $ part , $ partNo ) ; } return array_filter ( $ parsedParts ) ; }
Parse the email body and its parts

@param  resource $stream
@param  int $uid
@return array
Parse the email body and its parts