Parses a single part of an address header.
Represents a single part of a list of addresses. A part could be one email
address, or one 'group' containing multiple addresses. The consumer ends on
finding either a comma token, representing a separation between addresses, or
a semi-colon token representing the end of a group.
A single email address may consist of just an email, or a name and an email
address. Both of these are valid examples of a From header:
- From: jonsnow@winterfell.com
- From: Jon Snow jonsnow@winterfell.com
Groups must be named, for example:
- To: Winterfell: jonsnow@winterfell.com, Arya Stark arya@winterfell.com;
Addresses may contain quoted parts and comments, and names may be mime-header
encoded.
- author Zaahid Bateson
Methods |
public getTokenSeparators() : array Overridden to return patterns matching end tokens ("," and ";"), and
|
Properties |
Methods |
protected getSubConsumers() : array Returns the following as sub-consumers:
|
protected isEndToken(string $token) : bool Returns true for commas and semi-colons. Although the semi-colon is not strictly the end token of an |
protected isStartToken(string $token) : bool AddressConsumer is "greedy", so this always returns true. |
protected processParts(array $parts) : array Performs final processing on parsed parts. AddressConsumer's implementation looks for tokens representing the The returned array consists of a single element - either a
|
Methods |