Conditions | 3 |
Paths | 4 |
Total Lines | 25 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
22 | public function __invoke(ContainerInterface $container) |
||
23 | { |
||
24 | /** @var array $optionsArray */ |
||
25 | $optionsArray = $container->get('config')['facile']['sentry']['client'][$this->name]; |
||
26 | |||
27 | $options = new ClientOptions($optionsArray); |
||
28 | |||
29 | $ravenOptions = $options->getOptions(); |
||
30 | |||
31 | if (!array_key_exists('processors', $ravenOptions)) { |
||
32 | $ravenOptions['processors'] = [SanitizeDataProcessor::class]; |
||
33 | } |
||
34 | |||
35 | $ravenClient = new \Raven_Client($options->getDsn(), $ravenOptions); |
||
36 | |||
37 | $client = new Client($ravenClient, $options); |
||
38 | |||
39 | $errorHandlerListener = $container->get($options->getErrorHandlerListener()); |
||
40 | if ($errorHandlerListener instanceof ClientAwareInterface) { |
||
41 | $errorHandlerListener->setClient($client); |
||
42 | } |
||
43 | $client->setErrorHandlerListener($errorHandlerListener); |
||
44 | |||
45 | return $client; |
||
46 | } |
||
47 | } |
||
48 |