Reads an address list header using the AddressBaseConsumer.

An address list may consist of one or more addresses and address groups. Each address separated by a comma, and each group separated by a semi-colon.

For full specifications, see https://www.ietf.org/rfc/rfc2822.txt

author Zaahid Bateson
package MailMimeParser
inherited_from \ZBateson\MailMimeParser\Header\AbstractHeader

 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) 
Inherited

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
Inherited
: No additional processing is performed (for instance to wrap long lines.)

Returns

string

Returns all address parts in the header including all addresses that are in groups.

getAddresses() : array<mixed,\ZBateson\MailMimeParser\Header\Part\AddressPart>

Returns

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

Same as getValue, but for clarity to match AddressPart.

getEmail() : string

Returns

string

Returns all group parts in the header.

getGroups() : array<mixed,\ZBateson\MailMimeParser\Header\Part\AddressGroupPart>

Returns

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

Returns the name of the header.

getName() : string
Inherited

Returns

string

Returns an array of HeaderPart objects associated with this header.

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

Returns

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

Returns the name associated with the first email address to complement getValue().

getPersonName() : string

Returns

string

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

getRawValue() : string
Inherited

Returns

string

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

getValue() : string
Inherited

Returns

string

Returns true if an address exists with the passed email address.

hasAddress(string $email) : boolean

Comparison is done case insensitively.

Parameters

$email

string

Returns

boolean

Returns an AddressBaseConsumer.

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

Parameters

$consumerService

\ZBateson\MailMimeParser\Header\Consumer\ConsumerService

Returns

\ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer

Returns the header's Consumer

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

Parameters

$consumerService

\ZBateson\MailMimeParser\Header\Consumer\ConsumerService

Returns

\ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer

Overridden to extract all addresses into addresses array.

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

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

inherited_from \ZBateson\MailMimeParser\Header\AbstractHeader::setParseHeaderValue()

Parameters

$consumer

\ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer

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

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

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

Parameters

$consumer

\ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer

 Properties

 

array of addresses

$addresses : array<mixed,\ZBateson\MailMimeParser\Header\Part\AddressPart>

Default

array()
 

array of address groups

$groups : array<mixed,\ZBateson\MailMimeParser\Header\Part\AddressGroupPart>

Default

array()
 

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