src/MailMap/MailFactory.php
protected function parsePart($stream, $uid, $part, $partNo = 1)
    {
        if (!in_array($part->type, [TYPETEXT, TYPEMULTIPART])) {
            return null;
        }

        $body = imap_fetchbody($stream, $uid, $partNo, static::$bodyFlags);

        $body = static::decode($body, $part->encoding);
        if ('' !== ($charset = $this->findCharset($part))) {
            $body = static::convertBodyEncoding($body, $charset, $part->encoding);
        }

        return (object) [
            'body' => $body,
            'mime_type' => strtolower($part->subtype)
        ];
    }
protected function parsePart($stream, $uid, $part, $partNo = 1)
    {
        if (!in_array($part->type, [TYPETEXT, TYPEMULTIPART])) {
            return null;
        }

        $body = imap_fetchbody($stream, $uid, $partNo, static::$bodyFlags);

        $body = static::decode($body, $part->encoding);
        if ('' !== ($charset = $this->findCharset($part))) {
            $body = static::convertBodyEncoding($body, $charset, $part->encoding);
        }

        return (object) [
            'body' => $body,
            'mime_type' => strtolower($part->subtype)
        ];
    }
protected function parsePart ( $ stream , $ uid , $ part , $ partNo = 1 ) { if ( ! in_array ( $ part -> type , [ TYPETEXT , TYPEMULTIPART ] ) ) { return null ; } $ body = imap_fetchbody ( $ stream , $ uid , $ partNo , static :: $ bodyFlags ) ; $ body = static :: decode ( $ body , $ part -> encoding ) ; if ( '' !== ( $ charset = $ this -> findCharset ( $ part ) ) ) { $ body = static :: convertBodyEncoding ( $ body , $ charset , $ part -> encoding ) ; } return ( object ) [ 'body' => $ body , 'mime_type' => strtolower ( $ part -> subtype ) ] ; }
Parse individual part of the structure

@param  resource $stream
@param  int $uid
@param  stdClass $part
@param  int $partNo
@return stdClass | null
Parse individual part of the structure