Constructs various AbstractHeader 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:

AddressHeader: From, To, Cc, Bcc, Sender, Reply-To, Resent-From, Resent-To, Resent-Cc, Resent-Bcc, Resent-Reply-To DateHeader: Date, Resent-Date, Delivery-Date, Expires, Expiry-Date, Reply-By ParameterHeader: Content-Type, Content-Disposition IdHeader: Message-ID, Content-ID, In-Reply-To, References ReceivedHeader: Received

author Zaahid Bateson
package MailMimeParser

 Methods

Instantiates member variables with the passed objects.

__construct(\ZBateson\MailMimeParser\Header\Consumer\ConsumerService $consumerService) 

Parameters

$consumerService

\ZBateson\MailMimeParser\Header\Consumer\ConsumerService

Creates and returns a HeaderContainer.

newHeaderContainer() : \ZBateson\MailMimeParser\Header\HeaderContainer;

Returns

\ZBateson\MailMimeParser\Header\HeaderContainer;

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

newInstance(string $name, string $value) : \ZBateson\MailMimeParser\Header\AbstractHeader

Parameters

$name

string

$value

string

Returns

\ZBateson\MailMimeParser\Header\AbstractHeader

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

getClassFor(string $name) : string

Parameters

$name

string

Returns

string

 Properties

 

the passed ConsumerService providing AbstractConsumer singletons.

$consumerService : \ZBateson\MailMimeParser\Header\Consumer\ConsumerService

Default

 

Defines the generic AbstractHeader type to use for headers that aren't mapped in $types

$genericType : string

Default

'ZBateson\MailMimeParser\Header\GenericHeader'
 

maps AbstractHeader types to headers.

$types : array<mixed,string[]>

Default

array('ZBateson\MailMimeParser\Header\AddressHeader' => array('from', 'to', 'cc', 'bcc', 'sender', 'reply-to', 'resent-from', 'resent-to', 'resent-cc', 'resent-bcc', 'resent-reply-to'), 'ZBateson\MailMimeParser\Header\DateHeader' => array('date', 'resent-date', 'delivery-date', 'expires', 'expiry-date', 'reply-by'), 'ZBateson\MailMimeParser\Header\ParameterHeader' => array('content-type', 'content-disposition'), 'ZBateson\MailMimeParser\Header\SubjectHeader' => array('subject'), 'ZBateson\MailMimeParser\Header\IdHeader' => array('message-id', 'content-id', 'in-reply-to', 'references'), 'ZBateson\MailMimeParser\Header\ReceivedHeader' => array('received'))