Copied!

Collection of static methods that return callables for common IMultiPart child filters.

Abstract
Methods
public static fromAttachmentFilter() : callable
 

Provides an 'attachment' filter used by Message::getAttachmentPart.

The method filters out the following types of parts:

  • text/plain and text/html parts that do not have an 'attachment' disposition
  • any part that returns true for isMultiPart()
  • any part that returns true for isSignaturePart()
public static fromContentType(string $mimeType) : callable
 

Includes only parts that match the passed $mimeType in the return value of a call to 'getContentType()'.

  • param string $mimeType Mime type of parts to find.
public static fromDisposition(string $disposition, bool $includeMultipart = false, bool $includeSignedParts = false) : callable
 

Finds parts with the passed disposition (matching against IMessagePart::getContentDisposition()), optionally including multipart parts and signed parts.

  • param string $disposition The disposition to find.
  • param bool $includeMultipart Optionally include multipart parts by passing true (defaults to false).
  • param bool $includeSignedParts Optionally include signed parts (defaults to false).
public static fromHeaderValue(string $name, string $value, bool $excludeSignedParts = true) : callable
 

Provides a filter that keeps parts that contain a header of $name with a value that matches $value (case insensitive).

By default signed parts are excluded. Pass FALSE to the third parameter to include them.

  • param string $name The header name to look up
  • param string $value The value to match
  • param bool $excludeSignedParts Optional signed parts exclusion (defaults to true).
public static fromInlineContentType(string $mimeType) : callable
 

Returns parts matching $mimeType that do not have a Content-Disposition set to 'attachment'.

  • param string $mimeType Mime type of parts to find.
Methods
public static fromAttachmentFilter() : callable
 

Provides an 'attachment' filter used by Message::getAttachmentPart.

The method filters out the following types of parts:

  • text/plain and text/html parts that do not have an 'attachment' disposition
  • any part that returns true for isMultiPart()
  • any part that returns true for isSignaturePart()
public static fromContentType(string $mimeType) : callable
 

Includes only parts that match the passed $mimeType in the return value of a call to 'getContentType()'.

  • param string $mimeType Mime type of parts to find.
public static fromDisposition(string $disposition, bool $includeMultipart = false, bool $includeSignedParts = false) : callable
 

Finds parts with the passed disposition (matching against IMessagePart::getContentDisposition()), optionally including multipart parts and signed parts.

  • param string $disposition The disposition to find.
  • param bool $includeMultipart Optionally include multipart parts by passing true (defaults to false).
  • param bool $includeSignedParts Optionally include signed parts (defaults to false).
public static fromHeaderValue(string $name, string $value, bool $excludeSignedParts = true) : callable
 

Provides a filter that keeps parts that contain a header of $name with a value that matches $value (case insensitive).

By default signed parts are excluded. Pass FALSE to the third parameter to include them.

  • param string $name The header name to look up
  • param string $value The value to match
  • param bool $excludeSignedParts Optional signed parts exclusion (defaults to true).
public static fromInlineContentType(string $mimeType) : callable
 

Returns parts matching $mimeType that do not have a Content-Disposition set to 'attachment'.

  • param string $mimeType Mime type of parts to find.
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration