| Conditions | 4 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 2 | public function __invoke(ContainerInterface $serviceLocator) |
|
| 18 | { |
||
| 19 | 2 | $configuration = $serviceLocator->get('Configuration'); |
|
| 20 | 2 | $transportName = $configuration['mt_mail']['transport']; |
|
| 21 | 2 | $service = new Sender($serviceLocator->get($transportName)); |
|
| 22 | |||
| 23 | 2 | if (isset($configuration['mt_mail']['sender_plugins']) |
|
| 24 | 2 | && is_array($configuration['mt_mail']['sender_plugins']) |
|
| 25 | 2 | ) { |
|
| 26 | 1 | $pluginManager = $serviceLocator->get('MtMail\Service\SenderPluginManager'); |
|
| 27 | 1 | foreach (array_unique($configuration['mt_mail']['sender_plugins']) as $plugin) { |
|
| 28 | 1 | $pluginManager->get($plugin)->attach($service->getEventManager()); |
|
| 29 | 1 | } |
|
| 30 | 1 | } |
|
| 31 | |||
| 32 | 2 | return $service; |
|
| 33 | } |
||
| 34 | } |
||
| 35 |