1 | <?php |
||
15 | class Mail implements MailInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $bodyText; |
||
21 | |||
22 | /** |
||
23 | * @var HtmlElementInterface |
||
24 | */ |
||
25 | protected $bodyHtml; |
||
26 | |||
27 | /** |
||
28 | * @var HtmlElementInterface |
||
29 | */ |
||
30 | protected $title; |
||
31 | |||
32 | /** |
||
33 | * @var MailAddressInterface |
||
34 | */ |
||
35 | protected $from; |
||
36 | |||
37 | /** |
||
38 | * @var MailAddressInterface[] |
||
39 | */ |
||
40 | protected $toRecipients = array(); |
||
41 | |||
42 | /** |
||
43 | * @var MailAddressInterface[] |
||
44 | */ |
||
45 | protected $ccRecipients = array(); |
||
46 | |||
47 | /** |
||
48 | * @var MailAddressInterface[] |
||
49 | */ |
||
50 | protected $bccRecipients = array(); |
||
51 | |||
52 | /** |
||
53 | * @var MailAttachmentInterface[] |
||
54 | */ |
||
55 | protected $attachements = array(); |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $encoding = 'utf-8'; |
||
61 | |||
62 | /** |
||
63 | * @var bool |
||
64 | */ |
||
65 | protected $autocreateMissingText = true; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $css; |
||
71 | |||
72 | public function __construct(string $title, string $bodyText = null) |
||
77 | |||
78 | /** |
||
79 | * Returns the mail text body. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getBodyText() :string |
||
87 | |||
88 | /** |
||
89 | * The mail text body. |
||
90 | * |
||
91 | * @Property |
||
92 | * |
||
93 | * @param string $bodyText |
||
94 | */ |
||
95 | public function setBodyText(string $bodyText) :string |
||
99 | |||
100 | /** |
||
101 | * Returns the mail html body. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getBodyHtml():string |
||
109 | |||
110 | /** |
||
111 | * The mail html body. |
||
112 | * |
||
113 | * @param HtmlElementInterface $bodyHtml |
||
114 | */ |
||
115 | public function setBodyHtml(HtmlElementInterface $bodyHtml) |
||
119 | |||
120 | /** |
||
121 | * Returns the mail title. |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function getTitle():string |
||
129 | |||
130 | /** |
||
131 | * The mail title. |
||
132 | * |
||
133 | * @param string $title |
||
134 | */ |
||
135 | public function setTitle(HtmlElementInterface $title) |
||
139 | |||
140 | /** |
||
141 | * Returns the "From" email address. |
||
142 | * |
||
143 | * @return MailAddressInterface The first element is the email address, the second the name to display. |
||
144 | */ |
||
145 | public function getFrom():MailAddressInterface |
||
149 | |||
150 | /** |
||
151 | * The mail from address. |
||
152 | * |
||
153 | * @param MailAddressInterface $from |
||
154 | */ |
||
155 | public function setFrom(MailAddressInterface $from) |
||
159 | |||
160 | /** |
||
161 | * Returns an array containing the recipients. |
||
162 | * |
||
163 | * @return MailAddressInterface[] |
||
164 | */ |
||
165 | public function getToRecipients(): array |
||
169 | |||
170 | /** |
||
171 | * An array containing the recipients. |
||
172 | * |
||
173 | * @param MailAddressInterface[] $toRecipients |
||
174 | */ |
||
175 | public function setToRecipients(array $toRecipients) |
||
179 | |||
180 | /** |
||
181 | * Adss a recipient. |
||
182 | * |
||
183 | * @param MailAddressInterface $toRecipient |
||
184 | */ |
||
185 | public function addToRecipient(MailAddressInterface $toRecipient) |
||
189 | |||
190 | /** |
||
191 | * Returns an array containing the recipients in Cc. |
||
192 | * |
||
193 | * @return MailAddressInterface[] |
||
194 | */ |
||
195 | public function getCcRecipients(): array |
||
199 | |||
200 | /** |
||
201 | * An array containing the recipients. |
||
202 | * |
||
203 | * |
||
204 | * @param MailAddressInterface[]$ccRecipients |
||
205 | */ |
||
206 | public function setCcRecipients(array $ccRecipients) |
||
210 | |||
211 | /** |
||
212 | * Adds a recipient. |
||
213 | * |
||
214 | * @param MailAddressInterface $ccRecipient |
||
215 | */ |
||
216 | public function addCcRecipient(MailAddressInterface $ccRecipient) |
||
220 | |||
221 | /** |
||
222 | * Returns an array containing the recipients in Bcc. |
||
223 | * |
||
224 | * @return MailAddressInterface[] |
||
225 | */ |
||
226 | public function getBccRecipients():array |
||
230 | |||
231 | /** |
||
232 | * An array containing the recipients. |
||
233 | * |
||
234 | * @param MailAddressInterface[] $bccRecipients |
||
235 | */ |
||
236 | public function setBccRecipients(array $bccRecipients) |
||
240 | |||
241 | /** |
||
242 | * Adds a recipient. |
||
243 | * |
||
244 | * @param MailAddressInterface $bccRecipient |
||
245 | */ |
||
246 | public function addBccRecipient(MailAddressInterface $bccRecipient) |
||
250 | |||
251 | /** |
||
252 | * Returns an array of attachements for that mail. |
||
253 | * |
||
254 | * @return MailAttachmentInterface[] |
||
255 | */ |
||
256 | public function getAttachements():array |
||
260 | |||
261 | /** |
||
262 | * An array containing the attachments. |
||
263 | * |
||
264 | * @param array<MailAttachmentInterface> $attachements |
||
265 | */ |
||
266 | public function setAttachements(array $attachements) |
||
270 | |||
271 | /** |
||
272 | * Adds an attachment. |
||
273 | * |
||
274 | * @param MailAttachmentInterface $attachement |
||
275 | */ |
||
276 | public function addAttachement(MailAttachmentInterface $attachement) |
||
280 | |||
281 | /** |
||
282 | * Returns the encoding of the mail. |
||
283 | * |
||
284 | * @return string |
||
285 | */ |
||
286 | public function getEncoding():string |
||
290 | |||
291 | /** |
||
292 | * The mail encoding. Defaults to utf-8. |
||
293 | * |
||
294 | * @param string $encoding |
||
295 | */ |
||
296 | public function setEncoding($encoding) |
||
300 | |||
301 | } |
||
302 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..