src/Header/Consumer/Received/DomainConsumer.php
protected function processParts(array $parts)
    {
        $ehloName = null;
        $hostname = null;
        $address = null;
        $commentPart = null;

        $filtered = $this->filterIgnoredSpaces($parts);
        foreach ($filtered as $part) {
            if ($part instanceof CommentPart) {
                $commentPart = $part;
                continue;
            }
            $ehloName .= $part->getValue();
        }

        $strValue = $ehloName;
        if ($commentPart !== null && $this->matchHostPart($commentPart->getComment(), $hostname, $address)) {
            $strValue .= ' (' . $commentPart->getComment() . ')';
            $commentPart = null;
        }

        $domainPart = $this->partFactory->newReceivedDomainPart(
            $this->getPartName(),
            $strValue,
            $ehloName,
            $hostname,
            $address
        );
        return array_filter([ $domainPart, $commentPart ]);
    }
protected function processParts(array $parts)
    {
        $ehloName = null;
        $hostname = null;
        $address = null;
        $commentPart = null;

        $filtered = $this->filterIgnoredSpaces($parts);
        foreach ($filtered as $part) {
            if ($part instanceof CommentPart) {
                $commentPart = $part;
                continue;
            }
            $ehloName .= $part->getValue();
        }

        $strValue = $ehloName;
        if ($commentPart !== null && $this->matchHostPart($commentPart->getComment(), $hostname, $address)) {
            $strValue .= ' (' . $commentPart->getComment() . ')';
            $commentPart = null;
        }

        $domainPart = $this->partFactory->newReceivedDomainPart(
            $this->getPartName(),
            $strValue,
            $ehloName,
            $hostname,
            $address
        );
        return array_filter([ $domainPart, $commentPart ]);
    }
protected function processParts ( array $ parts ) { $ ehloName = null ; $ hostname = null ; $ address = null ; $ commentPart = null ; $ filtered = $ this -> filterIgnoredSpaces ( $ parts ) ; foreach ( $ filtered as $ part ) { if ( $ part instanceof CommentPart ) { $ commentPart = $ part ; continue ; } $ ehloName .= $ part -> getValue ( ) ; } $ strValue = $ ehloName ; if ( $ commentPart !== null && $ this -> matchHostPart ( $ commentPart -> getComment ( ) , $ hostname , $ address ) ) { $ strValue .= ' (' . $ commentPart -> getComment ( ) . ')' ; $ commentPart = null ; } $ domainPart = $ this -> partFactory -> newReceivedDomainPart ( $ this -> getPartName ( ) , $ strValue , $ ehloName , $ hostname , $ address ) ; return array_filter ( [ $ domainPart , $ commentPart ] ) ; }
Creates a single ReceivedDomainPart out of matched parts.  If an
unmatched parenthesized expression was found, it's returned as a
CommentPart.

@param \ZBateson\MailMimeParser\Header\Part\HeaderPart[] $parts
@return \ZBateson\MailMimeParser\Header\Part\ReceivedDomainPart[]|
\ZBateson\MailMimeParser\Header\Part\CommentPart[]array
Creates a single ReceivedDomainPart out of matched parts . If an unmatched parenthesized expression was found it s returned as a CommentPart .