| 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\Message; |
| 9 |
|
| 10 |
/** |
| 11 |
* Represents part of a non-mime message. |
| 12 |
* |
| 13 |
* @author Zaahid Bateson |
| 14 |
*/ |
| 15 |
abstract class NonMimePart extends MessagePart |
| 16 |
{ |
| 17 |
/** |
| 18 |
* Returns true. |
| 19 |
* |
| 20 |
*/ |
| 21 |
public function isTextPart() : bool |
| 22 |
{ |
| 23 |
return true; |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Returns text/plain |
| 28 |
* |
| 29 |
* @return string |
| 30 |
*/ |
| 31 |
public function getContentType(string $default = 'text/plain') : ?string |
| 32 |
{ |
| 33 |
return $default; |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Returns ISO-8859-1 |
| 38 |
* |
| 39 |
* @return string |
| 40 |
*/ |
| 41 |
public function getCharset() : ?string |
| 42 |
{ |
| 43 |
return 'ISO-8859-1'; |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* Returns 'inline'. |
| 48 |
* |
| 49 |
* @return string |
| 50 |
*/ |
| 51 |
public function getContentDisposition(?string $default = 'inline') : ?string |
| 52 |
{ |
| 53 |
return 'inline'; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Returns '7bit'. |
| 58 |
* |
| 59 |
* @return string |
| 60 |
*/ |
| 61 |
public function getContentTransferEncoding(?string $default = '7bit') : ?string |
| 62 |
{ |
| 63 |
return '7bit'; |
| 64 |
} |
| 65 |
|
| 66 |
/** |
| 67 |
* Returns false. |
| 68 |
* |
| 69 |
*/ |
| 70 |
public function isMime() : bool |
| 71 |
{ |
| 72 |
return false; |
| 73 |
} |
| 74 |
|
| 75 |
/** |
| 76 |
* Returns the Content ID of the part. |
| 77 |
* |
| 78 |
* NonMimeParts do not have a Content ID, and so this simply returns null. |
| 79 |
* |
| 80 |
*/ |
| 81 |
public function getContentId() : ?string |
| 82 |
{ |
| 83 |
return null; |
| 84 |
} |
| 85 |
} |
| 86 |
|