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
- author Zaahid Bateson
CloneableInstantiable
Methods |
public __construct(Psr\Log\LoggerInterface $logger, ZBateson |
public getNormalizedHeaderName(string $header) : string Returns the string in lower-case, and with non-alphanumeric characters stripped out.
|
public newInstance(string $name, string $value) : ZBateson Creates an IHeader instance for the passed header name and value, and returns it.
|
public newInstanceOf(string $name, string $value, string $iHeaderClass) : ZBateson Creates an IHeader instance for the passed header name and value using the passed IHeader class, and returns it.
|
Properties |
protected array $consumerServices
|
protected $genericType = 'ZBateson\MailMimeParser\Header\GenericHeader'
|
protected Psr\Log\LoggerInterface $logger |
protected ZBateson
|
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']]
|
Methods |
private getClassFor(string $name) : string Returns the name of an IHeader class for the passed header name.
|