Copied!

Most basic representation of a single part of an email.

Abstract
Methods
public __construct(Psr\Log\LoggerInterface $logger, ZBateson\MailMimeParser\Message\PartStreamContainer $streamContainer, ?ZBateson\MailMimeParser\Message\IMimePart $parent = NULL)
public __toString() : string
public ZBateson\MailMimeParser\ErrorBag::addError(string $message, string $psrLogLevel, ?Throwable $exception = NULL) : static
public attach(SplObserver $observer) : void
public attachContentStream(Psr\Http\Message\StreamInterface $stream, string $streamCharset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET) : static
public detach(SplObserver $observer) : void
public detachContentStream() : static
public ZBateson\MailMimeParser\ErrorBag::getAllErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : array
public getBinaryContentResourceHandle() : ?mixed
public getBinaryContentStream() : ?ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getCharset() : ?string
 

Returns the charset of the content, or null if not applicable/defined.

  • return string|null the charset
public getContent(string $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET) : ?string
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentDisposition(?string $default = NULL) : ?string
 

Returns the content's disposition, or returns the value of $default if not defined.

  • param string $default Optional default value to return if not applicable/defined
  • return string|null the disposition.
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentId() : ?string
 

Returns the Content ID of the part, or null if not defined.

  • return string|null the content ID.
public getContentStream(string $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET) : ?ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentTransferEncoding(?string $default = NULL) : ?string
 

Returns the content transfer encoding used to encode the content on this part, or the value of $default if not defined.

  • param ?string $default Optional default value to return if not applicable/defined
  • return string|null the transfer encoding defined for the part.
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentType(string $default = 'text/plain') : ?string
 

Returns the mime type of the content, or $default if one is not set.

  • param string $default Optional override for the default return value of 'text/plain.
  • return string the mime type
public getErrorLoggingContextName() : string
public ZBateson\MailMimeParser\ErrorBag::getErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : array
public getFilename() : ?string
public getParent() : ?ZBateson\MailMimeParser\Message\IMimePart
public getResourceHandle() : ?mixed
public getStream() : Psr\Http\Message\StreamInterface
public ZBateson\MailMimeParser\ErrorBag::hasAnyErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : bool
public hasContent() : bool
public ZBateson\MailMimeParser\ErrorBag::hasErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : bool
public abstract ZBateson\MailMimeParser\Message\IMessagePart::isMime() : bool
 

Returns true if the current part is a mime part.

public abstract ZBateson\MailMimeParser\Message\IMessagePart::isTextPart() : bool
 

Returns true if the content of this part is plain text.

public notify() : void
public save( $filenameResourceOrStream, string $filemode = 'w+') : static
public saveContent( $filenameResourceOrStream) : static
public setCharsetOverride(string $charsetOverride, bool $onlyIfNoCharset = false) : static
public setContent( $resource, string $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET) : static
Properties
protected ?string $charsetOverride = NULL
 
  • var ?string can be used to set an override for content's charset in cases where a user knows the charset on the content is not what it claims to be.
protected bool $ignoreTransferEncoding = false
 
  • var bool set to true when a user attaches a stream manually, it's assumed to already be decoded or to have relevant transfer encoding decorators attached already.
protected Psr\Log\LoggerInterface ZBateson\MailMimeParser\ErrorBag::$logger
protected SplObjectStorage $observers
 
  • var \SplObjectStorage attached observers that need to be notified of modifications to this part.
protected ?ZBateson\MailMimeParser\Message\IMimePart $parent
 
  • var ?\IMimePart parent part
protected ZBateson\MailMimeParser\Message\PartStreamContainer $partStreamContainer
 
  • var \PartStreamContainer holds 'stream' and 'content stream'.
Methods
protected getErrorBagChildren() : array
protected ZBateson\MailMimeParser\ErrorBag::validate() : void
 

Perform any extra validation and call 'addError'.

getErrors and getAllErrors call validate() if their $validate parameter is true. validate() is only called once on an object with getErrors getAllErrors.

© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration