Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | protected function sendEmail(ResultsCollection $results): void |
||
28 | { |
||
29 | $body = ''; |
||
30 | |||
31 | foreach ($results as $check) { |
||
32 | /* @var $check CheckInterface */ |
||
33 | /* @var $result ResultInterface */ |
||
34 | $result = $results[$check] ?? null; |
||
35 | |||
36 | if ($result instanceof ResultInterface) { |
||
37 | $body .= sprintf('[%s] %s', $check->getLabel(), $result->getMessage()); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | |||
42 | $message = (new Email()) |
||
43 | ->subject($this->subject) |
||
44 | ->from($this->sender) |
||
45 | ->to(...$this->recipients) |
||
46 | ->text($body); |
||
47 | |||
48 | $this->mailer->send($message); |
||
49 | } |
||
50 | } |
||
51 |