@param Part $part

@return bool
777018
protected function isEnvelopedEmail(Part $part)
    {
        if (!$this->hasHeader($part, 'Content-Type')) {
            return false;
        }

        return $this->getContentType($part)->getType() == 'message/rfc822';
    }
1144519
public function addPart(self $part = null): self
    {
        return $this->parts[] = $part === null ? new self : $part;
    }
716769
protected function _quoteIdentifierPart($part)
        {
            if ($part === '*') {
                return $part;
            }

            $quote_character = self::$_config[$this->_connection_name]['identifier_quote_character'];
            // double up any identifier quotes to escape them
            return $quote_character .
                str_replace($quote_character,
                    $quote_character . $quote_character,
                    $part
            ) . $quote_character;
        }
954715
public function is_attachment($part)
    {
        foreach ($this->attachments as $att_part) {
            if ($att_part->mime_id == $part->mime_id) {
                return true;
            }

            // check if the part is a subpart of another attachment part (message/rfc822)
            if ($att_part->mimetype == 'message/rfc822') {
                if (in_array($part, (array)$att_part->parts)) {
                    return true;
                }
            }
        }

        return false;
    }
1129379
private function PathPartRegistered( array & $a_path_part, array & $a_paths ) : bool {
    
        foreach ( $a_paths as $a_path ) {
        
            if ( $this->IsPathPart( $a_path_part, $a_path ) ) return true;
        
        }
    
        return false;
        
    }
242615
public function increment($part)
    {
        foreach (array_reverse(self::$ordinality) as $currentPart) {
            if ($currentPart === $part) {
                switch ($part) {
                    case self::STABILITY:
                        $this->set(
                            $currentPart, 
                            self::$stabilities[
                                array_search(
                                    $this->get($currentPart), 
                                    self::$stabilities
                                ) +1
                            ]
                        );
                        break;
                    default:
                        $this->set($currentPart, $this->get($currentPart) +1);
                        break;
                }
                break;
            } else {
                switch ($currentPart) {
                    case self::STABILITY_NO:
                        $this->set($currentPart, null);
                        break;
                    case self::STABILITY:
                        $this->set($currentPart, 'dev');
                        break;
                    default:
                        $this->set($currentPart, '0');
                }
            }
        }

        return $this;
    }
400645
public function remove($part)
    {
        foreach ($this->parts as $key => $value) {
            if ($value instanceof self) {
                $value->remove($part);
            } elseif ($value === $part) {
                unset($this->parts[$key]);
            }
        }
    }
1108993
private function check_context($part)
    {
        return $this->context === null || strpos($part->mime_id, $this->context . '.') === 0;
    }
863245
protected function hasUnmappedPartsBefore(array $parts, $index): bool
    {
        foreach ($parts as $k => $part) {
            if ($k === $index) {
                break;
            }

            if (!($part instanceof AbstractPart)) {
                return true;
            }
        }

        return false;
    }
392043
protected function _checkdigitAlg1($partNumber, $value) {
		$symbolsFlipped = array_flip($this->_symbols);
		$result = $partNumber;

		foreach (str_split($value) as $char) {
			$result = $result * 19 + $symbolsFlipped[$char];
		}
		return $this->_symbols[$result % (count($this->_symbols) - 1)];
	}
1051622
@SuppressWarnings("WeakerAccess")
	public static boolean isMimeType(@Nonnull final MimePart part, @Nonnull final String mimeType) {
		// Do not use part.isMimeType(String) as it is broken for MimeBodyPart
		// and does not really check the actual content type.

		try {
			final ContentType contentType = new ContentType(retrieveDataHandler(part).getContentType());
			return contentType.match(mimeType);
		} catch (final ParseException ex) {
			return retrieveContentType(part).equalsIgnoreCase(mimeType);
		}
	}
605167
protected function getPartFromText(&$part)
    {
        $start = $part['starting-pos'];
        $end = $part['ending-pos'];

        return substr($this->data, $start, $end - $start);
    }
1276097
public function render($part = 'content')
    {
        $return = '';
        switch ($part) {
            case 'content':
                $return = $this->renderContent();
                break;
            case 'filter':
                $return = $this->renderFilter();
                break;
            case 'summary':
                $return = $this->renderSummary();
                break;
            case 'header':
                $return = $this->renderHeader();
                break;
        }

        return $return;
    }
387153
private function failsSignedPartFilter(MessagePart $part)
    {
        if ($this->signedpart === static::FILTER_OFF) {
            return false;
        } elseif (!$part->isMime() || $part->getParent() === null) {
            return ($this->signedpart === static::FILTER_INCLUDE);
        }
        $partMimeType = $part->getContentType();
        $parentMimeType = $part->getParent()->getContentType();
        $parentProtocol = $part->getParent()->getHeaderParameter('Content-Type', 'protocol');
        if (strcasecmp($parentMimeType, 'multipart/signed') === 0 && strcasecmp($partMimeType, $parentProtocol) === 0) {
            return ($this->signedpart === static::FILTER_EXCLUDE);
        }
        return ($this->signedpart === static::FILTER_INCLUDE);
    }
999594
private function processQueryPart($part)
    {
        $queryPart = (string) $part;

        if (is_object($part) && $part instanceof self && $part->count() > 1) {
            return $this->preSeparator . $queryPart . $this->postSeparator;
        }

        // Fixes DDC-1237: User may have added a where item containing nested expression (with "OR" or "AND")
        if (stripos($queryPart, ' OR ') !== false || stripos($queryPart, ' AND ') !== false) {
            return $this->preSeparator . $queryPart . $this->postSeparator;
        }

        return $queryPart;
    }
1147100
public function addPart(PartInterface $part, $name = null)
    {
        if ($name == null) {
            $name = $part->getName();
        }
        $this->parts[$name] = $part;
    }
295201
public function equals($other, $parts=['scheme', 'user', 'host', 'path'])
    {
        $other = $other instanceof UrlContract ? $other : new static($other);
        $parts = (array)$parts;

        foreach ($parts as $part) {
            if ($part == 'path') {
                continue;
            }
            if ($this->$part != $other->$part) {
                return false;
            }
        }

        if (!in_array('path', $parts)) {
            return true;
        }

        return $this->path->equals($other->path);
    }