src/Message/Helper/MultipartHelper.php
public function findOtherContentPartFor(Message $message, $mimeType)
    {
        $altPart = $message->getPart(
            0,
            PartFilter::fromInlineContentType(($mimeType === 'text/plain') ? 'text/html' : 'text/plain')
        );
        if ($altPart !== null && $altPart->getParent() !== null && $altPart->getParent()->isMultiPart()) {
            $altPartParent = $altPart->getParent();
            if ($altPartParent->getChildCount(PartFilter::fromDisposition('inline', PartFilter::FILTER_EXCLUDE)) !== 1) {
                $altPart = $this->createMultipartRelatedPartForInlineChildrenOf($altPartParent);
            }
        }
        return $altPart;
    }
public function findOtherContentPartFor(Message $message, $mimeType)
    {
        $altPart = $message->getPart(
            0,
            PartFilter::fromInlineContentType(($mimeType === 'text/plain') ? 'text/html' : 'text/plain')
        );
        if ($altPart !== null && $altPart->getParent() !== null && $altPart->getParent()->isMultiPart()) {
            $altPartParent = $altPart->getParent();
            if ($altPartParent->getChildCount(PartFilter::fromDisposition('inline', PartFilter::FILTER_EXCLUDE)) !== 1) {
                $altPart = $this->createMultipartRelatedPartForInlineChildrenOf($altPartParent);
            }
        }
        return $altPart;
    }
public function findOtherContentPartFor ( Message $ message , $ mimeType ) { $ altPart = $ message -> getPart ( 0 , PartFilter :: fromInlineContentType ( ( $ mimeType === 'text/plain' ) ? 'text/html' : 'text/plain' ) ) ; if ( $ altPart !== null && $ altPart -> getParent ( ) !== null && $ altPart -> getParent ( ) -> isMultiPart ( ) ) { $ altPartParent = $ altPart -> getParent ( ) ; if ( $ altPartParent -> getChildCount ( PartFilter :: fromDisposition ( 'inline' , PartFilter :: FILTER_EXCLUDE ) ) !== 1 ) { $ altPart = $ this -> createMultipartRelatedPartForInlineChildrenOf ( $ altPartParent ) ; } } return $ altPart ; }
Finds an alternative inline part in the message and returns it if one
exists.

If the passed $mimeType is text/plain, searches for a text/html part.
Otherwise searches for a text/plain part to return.

@param Message $message
@param string $mimeType
@return \ZBateson\MailMimeParser\Message\Part\MimeType or null if not
found
Finds an alternative inline part in the message and returns it if one exists .