| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 1 | public function process(Mail $mail, ProcessResult $result): ProcessResult |
|
| 38 | { |
||
| 39 | 1 | if ($result->errored()) { |
|
| 40 | 1 | return $result; |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | if ($this->mailer->send($mail)) { |
|
| 44 | 1 | $result->setStatus(ProcessResult::SUCCEEDED); |
|
| 45 | } else { |
||
| 46 | 1 | $result->setStatus(ProcessResult::FAILED); |
|
| 47 | 1 | $result->addInfo(self::class, $this->mailer->getErrorInfo()); |
|
| 48 | } |
||
| 49 | |||
| 50 | 1 | return $result; |
|
| 51 | } |
||
| 52 | } |