| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class MailMessageWorker |
||
| 11 | { |
||
| 12 | use EventHandlerTrait; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var Mailer instance to the send the mails |
||
| 16 | */ |
||
| 17 | |||
| 18 | |||
| 19 | private $mailer; |
||
| 20 | /** |
||
| 21 | * @var MailMessage the mail message to be sent |
||
| 22 | */ |
||
| 23 | private $mailMessage; |
||
| 24 | /** |
||
| 25 | * MailMessageWorker constructor. |
||
| 26 | * |
||
| 27 | * @param Mailer $mailer |
||
| 28 | 3 | * @param MailMessage $mailMessage |
|
| 29 | */ |
||
| 30 | 3 | public function __construct(Mailer $mailer, MailMessage $mailMessage) |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Sends the MailMessage. It does triggers the following events:. |
||
| 38 | * |
||
| 39 | * - onSuccess: If the sending has been successful |
||
| 40 | * - onFailure: If the sending has failed |
||
| 41 | * |
||
| 42 | * The events need to be configured by attaching a handler to them. |
||
| 43 | * |
||
| 44 | 3 | * @see EventHandlerTrait |
|
| 45 | */ |
||
| 46 | 3 | public function run() |
|
| 60 |