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