Abstract base class representing a mime email's header.

The base class sets up the header's consumer, sets the name of the header and calls the consumer to parse the header's value.

AbstractHeader::getConsumer is an abstract method that must be overridden to return an appropriate Consumer\AbstractConsumer type.

author Zaahid Bateson
package MailMimeParser

 Methods

Assigns the header's name and raw value, then calls getConsumer and setParseHeaderValue to extract a parsed value.

__construct(\ZBateson\MailMimeParser\Header\Consumer\ConsumerService $consumerService, string $name, string $value) 

Parameters

$consumerService

\ZBateson\MailMimeParser\Header\Consumer\ConsumerService

$name

string

$value

string

Returns the string representation of the header. At the moment this is just in the form of:

__toString() : string
: No additional processing is performed (for instance to wrap long lines.)

Returns

string

Returns the name of the header.

getName() : string

Returns

string

Returns an array of HeaderPart objects associated with this header.

getParts() : array<mixed,\ZBateson\MailMimeParser\Header\Part\HeaderPart>

Returns

array<mixed,\ZBateson\MailMimeParser\Header\Part\HeaderPart>

Returns the raw value of the header prior to any processing.

getRawValue() : string

Returns

string

Returns the parsed value of the header -- calls getValue on $this->part

getValue() : string

Returns

string

Returns the header's Consumer

getConsumer(\ZBateson\MailMimeParser\Header\Consumer\ConsumerService $consumerService) : \ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer

Parameters

$consumerService

\ZBateson\MailMimeParser\Header\Consumer\ConsumerService

Returns

\ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer

Calls the consumer and assigns the parsed parts to member variables.

setParseHeaderValue(\ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer $consumer) 

The default implementation assigns the returned value to $this->part.

Parameters

$consumer

\ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer

 Properties

 

the name of the header

$name : string

Default

 

the header's parts (as returned from the consumer)

$parts : array<mixed,\ZBateson\MailMimeParser\Header\Part\HeaderPart>

Default

 

the raw value

$rawValue : string

Default