Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | protected function sendEmail(ResultsCollection $results) |
||
34 | { |
||
35 | $body = ''; |
||
36 | |||
37 | foreach ($results as $check) { |
||
38 | /* @var $check CheckInterface */ |
||
39 | /* @var $result ResultInterface */ |
||
40 | $result = $results[$check] ?? null; |
||
41 | |||
42 | if ($result instanceof ResultInterface) { |
||
43 | $body .= sprintf("Check: %s\n", $check->getLabel()); |
||
44 | $body .= sprintf("Message: %s\n\n", $result->getMessage()); |
||
45 | } |
||
46 | } |
||
47 | |||
48 | $message = (new Swift_Message()) |
||
49 | ->setSubject($this->subject) |
||
50 | ->setFrom($this->sender) |
||
51 | ->setTo($this->recipients) |
||
52 | ->setBody($body); |
||
53 | |||
54 | $this->mailer->send($message); |
||
55 | } |
||
56 | } |
||
57 |