| 1 |
<?php |
| 2 |
/** |
| 3 |
* This file is part of the ZBateson\MailMimeParser project. |
| 4 |
* |
| 5 |
* @license http://opensource.org/licenses/bsd-license.php BSD |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace ZBateson\MailMimeParser\Header; |
| 9 |
|
| 10 |
/** |
| 11 |
* A mime email header line consisting of a name and value. |
| 12 |
* |
| 13 |
* The header object provides methods to access the header's name, raw value, |
| 14 |
* and also its parsed value. The parsed value will depend on the type of |
| 15 |
* header and in some cases may be broken up into other parts (for example email |
| 16 |
* addresses in an address header, or parameters in a parameter header). |
| 17 |
* |
| 18 |
* @author Zaahid Bateson |
| 19 |
*/ |
| 20 |
interface IHeader |
| 21 |
{ |
| 22 |
/** |
| 23 |
* Returns an array of IHeaderPart objects the header's value has been |
| 24 |
* parsed into. |
| 25 |
* |
| 26 |
* @return IHeaderPart[] The array of parts. |
| 27 |
*/ |
| 28 |
public function getParts() : array; |
| 29 |
|
| 30 |
/** |
| 31 |
* Returns the parsed 'value' of the header. |
| 32 |
* |
| 33 |
* For headers that contain multiple parts, like address headers (To, From) |
| 34 |
* or parameter headers (Content-Type), the 'value' is the value of the |
| 35 |
* first parsed part. |
| 36 |
* |
| 37 |
* @return string The value |
| 38 |
*/ |
| 39 |
public function getValue() : ?string; |
| 40 |
|
| 41 |
/** |
| 42 |
* Returns the raw value of the header. |
| 43 |
* |
| 44 |
* @return string The raw value. |
| 45 |
*/ |
| 46 |
public function getRawValue() : string; |
| 47 |
|
| 48 |
/** |
| 49 |
* Returns the name of the header. |
| 50 |
* |
| 51 |
* @return string The name. |
| 52 |
*/ |
| 53 |
public function getName() : string; |
| 54 |
|
| 55 |
/** |
| 56 |
* Returns the string representation of the header. |
| 57 |
* |
| 58 |
* i.e.: '<HeaderName>: <RawValue>' |
| 59 |
* |
| 60 |
* @return string The string representation. |
| 61 |
*/ |
| 62 |
public function __toString() : string; |
| 63 |
} |
| 64 |
|