1 | <?php |
||
16 | class HeaderPartFactory |
||
17 | { |
||
18 | /** |
||
19 | * @var CharsetConverter $charsetConverter passed to HeaderPart constructors |
||
20 | * for converting strings in HeaderPart::convertEncoding |
||
21 | */ |
||
22 | protected $charsetConverter; |
||
23 | |||
24 | /** |
||
25 | * Sets up dependencies. |
||
26 | * |
||
27 | * @param CharsetConverter $charsetConverter |
||
28 | */ |
||
29 | 10 | public function __construct(CharsetConverter $charsetConverter) |
|
33 | |||
34 | /** |
||
35 | * Creates and returns a default HeaderPart for this factory, allowing |
||
36 | * subclass factories for specialized HeaderParts. |
||
37 | * |
||
38 | * The default implementation returns a new Token. |
||
39 | * |
||
40 | * @param string $value |
||
41 | * @return HeaderPart |
||
42 | */ |
||
43 | 1 | public function newInstance($value) |
|
47 | |||
48 | /** |
||
49 | * Initializes and returns a new Token. |
||
50 | * |
||
51 | * @param string $value |
||
52 | * @return \ZBateson\MailMimeParser\Header\Part\Token |
||
53 | */ |
||
54 | 2 | public function newToken($value) |
|
58 | |||
59 | /** |
||
60 | * Instantiates and returns a SplitParameterToken with the given name. |
||
61 | * |
||
62 | * @param string $name |
||
63 | * @return SplitParameterToken |
||
64 | */ |
||
65 | 1 | public function newSplitParameterToken($name) |
|
69 | |||
70 | /** |
||
71 | * Initializes and returns a new LiteralPart. |
||
72 | * |
||
73 | * @param string $value |
||
74 | * @return \ZBateson\MailMimeParser\Header\Part\LiteralPart |
||
75 | */ |
||
76 | 1 | public function newLiteralPart($value) |
|
80 | |||
81 | /** |
||
82 | * Initializes and returns a new MimeLiteralPart. |
||
83 | * |
||
84 | * @param string $value |
||
85 | * @return \ZBateson\MailMimeParser\Header\Part\MimeLiteralPart |
||
86 | */ |
||
87 | 1 | public function newMimeLiteralPart($value) |
|
91 | |||
92 | /** |
||
93 | * Initializes and returns a new CommentPart. |
||
94 | * |
||
95 | * @param string $value |
||
96 | * @return \ZBateson\MailMimeParser\Header\Part\CommentPart |
||
97 | */ |
||
98 | 1 | public function newCommentPart($value) |
|
102 | |||
103 | /** |
||
104 | * Initializes and returns a new AddressPart. |
||
105 | * |
||
106 | * @param string $name |
||
107 | * @param string $email |
||
108 | * @return \ZBateson\MailMimeParser\Header\Part\AddressPart |
||
109 | */ |
||
110 | 1 | public function newAddressPart($name, $email) |
|
114 | |||
115 | /** |
||
116 | * Initializes and returns a new AddressGroupPart |
||
117 | * |
||
118 | * @param array $addresses |
||
119 | * @param string $name |
||
120 | * @return \ZBateson\MailMimeParser\Header\Part\AddressGroupPart |
||
121 | */ |
||
122 | 1 | public function newAddressGroupPart(array $addresses, $name = '') |
|
126 | |||
127 | /** |
||
128 | * Initializes and returns a new DatePart |
||
129 | * |
||
130 | * @param string $value |
||
131 | * @return \ZBateson\MailMimeParser\Header\Part\DatePart |
||
132 | */ |
||
133 | 1 | public function newDatePart($value) |
|
137 | |||
138 | /** |
||
139 | * Initializes and returns a new ParameterPart. |
||
140 | * |
||
141 | * @param string $name |
||
142 | * @param string $value |
||
143 | * @param string $language |
||
144 | * @return \ZBateson\MailMimeParser\Header\Part\ParameterPart |
||
145 | */ |
||
146 | 1 | public function newParameterPart($name, $value, $language = null) |
|
150 | } |
||
151 |