Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function fromEmail(Email $email): EmailEntity |
||
17 | { |
||
18 | $emailEntity = (new EmailEntity()) |
||
19 | ->setSubject($email->getSubject()) |
||
|
|||
20 | ->setTargetMail($email->getTo()[0]->toString()) |
||
21 | ->setBodyText($email->getTextBody()) |
||
22 | ->setBodyHtml($email->getHtmlBody()); |
||
23 | |||
24 | if (count($email->getFrom()) > 0) { |
||
25 | $emailEntity->setFrom($email->getFrom()[0]->toString()); |
||
26 | } |
||
27 | |||
28 | if (count($email->getReplyTo()) > 0) { |
||
29 | $emailEntity->setFrom($email->getReplyTo()[0]->toString()); |
||
30 | } |
||
31 | |||
32 | return $emailEntity; |
||
33 | } |
||
35 |