Conditions | 2 |
Paths | 2 |
Total Lines | 41 |
Code Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | protected function configure(string $sender, string $repository) |
||
31 | { |
||
32 | $dotenv = new Dotenv(); |
||
33 | try { |
||
34 | $dotenv->load(__DIR__ . '/../../.env'); |
||
35 | } catch (PathException $e) { |
||
36 | // Nothing |
||
37 | } |
||
38 | |||
39 | $extension = new EmailEngineExtension(); |
||
40 | $container = new ContainerBuilder(); |
||
41 | $container->setParameter('kernel.project_dir', getenv('KERNEL_PROJECT_DIR')); |
||
42 | $container->setParameter('kernel.root_dir', realpath(__DIR__ . '/../../../../SfCod/')); |
||
43 | $container->set(LoggerInterface::class, new Logger('test')); |
||
44 | $container->set(\Swift_Mailer::class, new \Swift_Mailer(new \Swift_Transport_NullTransport(new \Swift_Events_SimpleEventDispatcher()))); |
||
45 | |||
46 | $extension->load([ |
||
47 | [ |
||
48 | 'main_sender' => 'default', |
||
49 | ], |
||
50 | [ |
||
51 | 'senders' => [ |
||
52 | 'default' => [ |
||
53 | 'sender' => [ |
||
54 | 'class' => $sender, |
||
55 | ], |
||
56 | 'repository' => [ |
||
57 | 'class' => $repository, |
||
58 | ], |
||
59 | ], |
||
60 | ], |
||
61 | ], |
||
62 | [ |
||
63 | 'templates' => [ |
||
64 | 'SfCod\EmailEngineBundle\Example\TestEmailTemplate', |
||
65 | ], |
||
66 | ], |
||
67 | ], $container); |
||
68 | |||
69 | $this->container = $container; |
||
70 | } |
||
71 | } |
||
72 |