| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 4 | public function compose(array $context = [], Email $message = null): Email |
|
| 26 | { |
||
| 27 | 4 | $message = $message ?? new TemplatedEmail(); |
|
| 28 | 4 | if (!$message instanceof TemplatedEmail) { |
|
| 29 | 1 | throw new InvalidArgumentException(sprintf('Expected instance of %s, instance of %s given', TemplatedEmail::class, \get_class($message))); |
|
| 30 | } |
||
| 31 | |||
| 32 | 3 | (new ApplyEmailMessageOptions())->apply($message, $this->messageOptions); |
|
| 33 | 3 | $this->applyTemplates($context, $message); |
|
| 34 | |||
| 35 | 3 | return $message; |
|
| 36 | } |
||
| 51 |