Copied!

Constructs various IHeader types depending on the type of header passed.

If the passed header resolves to a specific defined header type, it is parsed as such. Otherwise, a GenericHeader is instantiated and returned. Headers are mapped as follows:

  • {@see \AddressHeader}: From, To, Cc, Bcc, Sender, Reply-To, Resent-From, Resent-To, Resent-Cc, Resent-Bcc, Resent-Reply-To, Return-Path, Delivered-To
  • {@see \DateHeader}: Date, Resent-Date, Delivery-Date, Expires, Expiry-Date, Reply-By
  • {@see \ParameterHeader}: Content-Type, Content-Disposition, Received-SPF, Authentication-Results, DKIM-Signature, Autocrypt
  • {@see \SubjectHeader}: Subject
  • {@see \IdHeader}: Message-ID, Content-ID, In-Reply-To, References
  • {@see \ReceivedHeader}: Received
CloneableInstantiable
Methods
public __construct(ZBateson\MailMimeParser\Header\Consumer\ConsumerService $consumerService, ZBateson\MailMimeParser\Header\Part\MimeLiteralPartFactory $mimeLiteralPartFactory)
 

Instantiates member variables with the passed objects.

public getNormalizedHeaderName(string $header) : string
 

Returns the string in lower-case, and with non-alphanumeric characters stripped out.

  • param string $header The header name
  • return string The normalized header name
public newInstance(string $name, string $value)
 

Creates an IHeader instance for the passed header name and value, and returns it.

  • param string $name The header name.
  • param string $value The header value.
  • return \IHeader The created header object.
public newInstanceOf(string $name, string $value, string $iHeaderClass) : ZBateson\MailMimeParser\Header\IHeader
 

Creates an IHeader instance for the passed header name and value, and returns it.

  • param string $name The header name.
  • param string $value The header value.
  • return \IHeader The created header object.
Properties
protected $consumerService = NULL
 
  • var \ConsumerService the passed ConsumerService providing AbstractConsumer singletons.
protected $genericType = 'ZBateson\MailMimeParser\Header\GenericHeader'
 
  • var string Defines the generic IHeader type to use for headers that aren't mapped in $types
protected $mimeLiteralPartFactory = NULL
 
  • var \MimeLiteralPartFactory for mime decoding.
protected $types = ['ZBateson\MailMimeParser\Header\AddressHeader' => ['from', 'to', 'cc', 'bcc', 'sender', 'replyto', 'resentfrom', 'resentto', 'resentcc', 'resentbcc', 'resentreplyto', 'returnpath', 'deliveredto'], 'ZBateson\MailMimeParser\Header\DateHeader' => ['date', 'resentdate', 'deliverydate', 'expires', 'expirydate', 'replyby'], 'ZBateson\MailMimeParser\Header\ParameterHeader' => ['contenttype', 'contentdisposition', 'receivedspf', 'authenticationresults', 'dkimsignature', 'autocrypt'], 'ZBateson\MailMimeParser\Header\SubjectHeader' => ['subject'], 'ZBateson\MailMimeParser\Header\IdHeader' => ['messageid', 'contentid', 'inreplyto', 'references'], 'ZBateson\MailMimeParser\Header\ReceivedHeader' => ['received']]
 
  • var string[][] maps IHeader types to headers.
Methods
private getClassFor(string $name) : string
 

Returns the name of an IHeader class for the passed header name.

  • param string $name The header name.
  • return string The Fully Qualified class name.
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration