| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function process(ContainerBuilder $container) |
||
| 22 | { |
||
| 23 | if (false === $container->hasParameter('liip_monitor.mailer.enabled')) { |
||
| 24 | return; |
||
| 25 | } |
||
| 26 | |||
| 27 | if (false === $container->getParameter('liip_monitor.mailer.enabled')) { |
||
| 28 | return; |
||
| 29 | } |
||
| 30 | |||
| 31 | if (!$container->hasDefinition('mailer')) { |
||
| 32 | throw new \InvalidArgumentException('To enable mail reporting you have to install the "swiftmailer/swiftmailer" or "symfony/mailer".'); |
||
| 33 | } |
||
| 34 | |||
| 35 | $definition = $container->getDefinition('mailer'); |
||
| 36 | $filename = \Swift_Mailer::class !== $definition->getClass() ? 'symfony_mailer.xml' : 'swift_mailer.xml'; |
||
| 37 | |||
| 38 | $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../../Resources/config')); |
||
| 39 | $loader->load($filename); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |