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