| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function __invoke(ContainerInterface $container): TransportInterface |
||
| 23 | { |
||
| 24 | $config = $container->get('config'); |
||
| 25 | |||
| 26 | // Setup SMTP transport, or a mock one |
||
| 27 | $configSmtp = $config['smtp'] ?? null; |
||
| 28 | if ($configSmtp) { |
||
| 29 | $transport = new Smtp(); |
||
| 30 | $options = new SmtpOptions($config['smtp']); |
||
| 31 | $transport->setOptions($options); |
||
| 32 | } else { |
||
| 33 | $transport = new InMemory(); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $transport; |
||
| 37 | } |
||
| 39 |